File: qgsserverrequest.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 161
file content (239 lines) | stat: -rw-r--r-- 5,750 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/server/qgsserverrequest.h                                        *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsServerRequest
{
%Docstring(signature="appended")
:py:class:`QgsServerRequest` Class defining request interface passed to
services :py:func:`QgsService.executeRequest()` method
%End

%TypeHeaderCode
#include "qgsserverrequest.h"
%End
  public:
    static const QMetaObject staticMetaObject;

  public:
    typedef QMap<QString, QString> Parameters;
    typedef QMap<QString, QString> Headers;

    enum Method /BaseType=IntEnum/
    {
      HeadMethod,
      PutMethod,
      GetMethod,
      PostMethod,
      DeleteMethod,
      PatchMethod
    };

    enum RequestHeader /BaseType=IntEnum/
    {

      HOST,
      FORWARDED,
      X_FORWARDED_FOR,
      X_FORWARDED_HOST,
      X_FORWARDED_PROTO,
      X_QGIS_SERVICE_URL,
      X_QGIS_WMS_SERVICE_URL,
      X_QGIS_WFS_SERVICE_URL,
      X_QGIS_WCS_SERVICE_URL,
      X_QGIS_WMTS_SERVICE_URL,
      ACCEPT,
      USER_AGENT,
      AUTHORIZATION,
    };

    QgsServerRequest();

    QgsServerRequest( const QString &url, QgsServerRequest::Method method = QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers() );
%Docstring
Constructor

:param url: the url string
:param method: the request method
:param headers: 
%End

    QgsServerRequest( const QUrl &url, QgsServerRequest::Method method = QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers() );
%Docstring
Constructor

:param url: QUrl
:param method: the request method
:param headers: 
%End

    QgsServerRequest( const QgsServerRequest &other );

    virtual ~QgsServerRequest();

    static QString methodToString( const Method &method );
%Docstring
Returns a string representation of an HTTP request ``method``.

.. versionadded:: 3.12
%End


    QUrl url() const;
%Docstring
:return: the request url as seen by QGIS server

.. seealso:: :py:func:`originalUrl` for the unrewritten url as seen by the web server, by default the two are equal
%End

    QgsServerRequest::Method method() const;
%Docstring
:return: the request method
%End

    QgsServerRequest::Parameters parameters() const;
%Docstring
Returns a map of query parameters with keys converted to uppercase
%End

    QgsServerParameters serverParameters() const;
%Docstring
Returns parameters
%End

    virtual void setParameter( const QString &key, const QString &value );
%Docstring
Set a parameter
%End

    QString parameter( const QString &key, const QString &defaultValue = QString() ) const;
%Docstring
Gets a parameter value
%End

    virtual void removeParameter( const QString &key );
%Docstring
Remove a parameter
%End

    virtual QString header( const QString &name ) const;
%Docstring
Returns the header value

:param name: of the header

:return: the header value or an empty string
%End

    virtual QString header( const RequestHeader &headerEnum ) const;
%Docstring
Returns the header value

:param headerEnum: of the header

:return: the header value or an empty string
%End

    void setHeader( const QString &name, const QString &value );
%Docstring
Set an header

:param name: 
:param value: 
%End

    QMap<QString, QString> headers() const;
%Docstring
Returns the header map

:return: the headers map
%End

    void removeHeader( const QString &name );
%Docstring
Remove an header

:param name: 

.. versionadded:: 3.20
%End

    virtual QByteArray data() const;
%Docstring
Returns post/put data Check for QByteArray.isNull() to check if data is
available.
%End

    virtual void setUrl( const QUrl &url );
%Docstring
Set the request url
%End

    QUrl originalUrl() const;
%Docstring
Returns the request url as seen by the web server, by default this is
equal to the url seen by QGIS server

.. seealso:: :py:func:`url` for the rewritten url

.. versionadded:: 3.6
%End

    QUrl baseUrl() const;
%Docstring
Returns the base URL of QGIS server

E.g. if we call QGIS server with
``http://example.com/folder?REQUEST=WMS&...`` the base URL will be
``http://example.com/folder``

.. versionadded:: 3.20
%End

    void setMethod( QgsServerRequest::Method method );
%Docstring
Set the request method
%End

    const QString queryParameter( const QString &name, const QString &defaultValue = QString() ) const;
%Docstring
Returns the query string parameter with the given ``name`` from the
request URL, a ``defaultValue`` can be specified.

.. versionadded:: 3.10
%End

  protected:
    void setOriginalUrl( const QUrl &url );
%Docstring
Set the request original ``url`` (the request url as seen by the web
server)

.. seealso:: :py:func:`setUrl` for the rewritten url

.. versionadded:: 3.6
%End

    void setBaseUrl( const QUrl &url );
%Docstring
Set the base URL of QGIS server

.. versionadded:: 3.20
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/server/qgsserverrequest.h                                        *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/