Class: QgsServerRequest¶
-
class
qgis.server.
QgsServerRequest
¶ Bases:
sip.wrapper
Constructor
QgsServerRequest(url: str, method: QgsServerRequest.Method = QgsServerRequest.GetMethod, headers: Dict[str, str] = {}) Constructor
- Parameters
url – the url string
method – the request method
headers –
QgsServerRequest(url: QUrl, method: QgsServerRequest.Method = QgsServerRequest.GetMethod, headers: Dict[str, str] = {}) Constructor
- Parameters
url – QUrl
method – the request method
headers –
QgsServerRequest(QgsServerRequest)
Enums
Methods
Returns post/put data Check for QByteArray.isNull() to check if data is available.
Returns the header value
Returns the header map
- return
the request method
Returns the request url as seen by the web server, by default this is equal to the url seen by QGIS server
Gets a parameter value
Returns a map of query parameters with keys converted to uppercase
Remove an header
Remove a parameter
Returns parameters
Set an header
Set the request method
Set the request original
url
(the request url as seen by the web server)Set a parameter
Set the request url
- return
the request url as seen by QGIS server
Signals
Attributes
-
DeleteMethod
= 4¶
-
GetMethod
= 2¶
-
HeadMethod
= 0¶
-
class
Method
¶ Bases:
int
-
PostMethod
= 3¶
-
PutMethod
= 1¶
-
data
(self) → QByteArray¶ Returns post/put data Check for QByteArray.isNull() to check if data is available.
-
header
(self, name: str) → str¶ Returns the header value
- Parameters
name – of the header
- Returns
the header value or an empty string
-
headers
(self) → Dict[str, str]¶ Returns the header map
- Returns
the headers map
-
method
(self) → QgsServerRequest.Method¶ - Returns
the request method
-
originalUrl
(self) → QUrl¶ Returns the request url as seen by the web server, by default this is equal to the url seen by QGIS server
See also
New in version 3.6.
-
parameter
(self, key: str) → str¶ Gets a parameter value
-
parameters
(self) → Dict[str, str]¶ Returns a map of query parameters with keys converted to uppercase
-
removeHeader
(self, name: str)¶ Remove an header
- Parameters
name –
-
removeParameter
(self, key: str)¶ Remove a parameter
-
serverParameters
(self) → QgsServerParameters¶ Returns parameters
-
setHeader
(self, name: str, value: str)¶ Set an header
- Parameters
name –
value –
-
setMethod
(self, method: QgsServerRequest.Method)¶ Set the request method
-
setOriginalUrl
(self, url: QUrl)¶ Set the request original
url
(the request url as seen by the web server)See also
New in version 3.6.
-
setParameter
(self, key: str, value: str)¶ Set a parameter
-
setUrl
(self, url: QUrl)¶ Set the request url
-
url
(self) → QUrl¶ - Returns
the request url as seen by QGIS server
See also
server, by default the two are equal