Class: QgsRequestHandler¶
-
class
qgis.server.
QgsRequestHandler
(request: QgsServerRequest, response: QgsServerResponse)¶ Bases:
sip.wrapper
Constructor
Note that QgsServerRequest and QgsServerResponse MUST live in the same scope
QgsRequestHandler(QgsRequestHandler)
This class is an interface hiding the details of reading input and writing output from/to a wms request mechanism.
Enums
Methods
Sets the info format string such as “text/xml”
Returns the response body data
Clears the response body and headers
Clear response buffer
Returns the request POST data (can be null)
Pointer to last raised exception
Returns the requested format string
Returns true if the HTTP headers were already sent to the client
Returns a request parameter
Returns the parsed parameters as a key-value pair, to modify a parameter setParameter( const QString &key, const QString &value) and removeParameter(const QString &key) must be used
Remove a request parameter
Remove an HTTP request header
Remove an HTTP response header
Retrieve request header value
Returns the the Request headers
Retrieve response header value
Returns the response headers
Send out HTTP headers and flush output buffer
Sets a request parameter
Sets an HTTP request header
Sets an HTTP response header
Allow plugins to return a
QgsMapServiceException
Sets response http status code
Returns the response http status code
Returns the request url
Signals
Attributes
-
appendBody
(self, body: Union[QByteArray, bytes, bytearray])¶ Sets the info format string such as “text/xml”
-
body
(self) → QByteArray¶ Returns the response body data
-
clear
(self)¶ Clears the response body and headers
-
clearBody
(self)¶ Clear response buffer
-
data
(self) → QByteArray¶ Returns the request POST data (can be null)
-
exceptionRaised
(self) → bool¶ Pointer to last raised exception
-
format
(self) → str¶ Returns the requested format string
-
headersSent
(self) → bool¶ Returns true if the HTTP headers were already sent to the client
-
parameter
(self, key: str) → str¶ Returns a request parameter
-
parameterMap
(self) → Dict[str, str]¶ Returns the parsed parameters as a key-value pair, to modify a parameter setParameter( const QString &key, const QString &value) and removeParameter(const QString &key) must be used
-
removeParameter
(self, key: str)¶ Remove a request parameter
-
removeRequestHeader
(self, name: str)¶ Remove an HTTP request header
-
removeResponseHeader
(self, name: str)¶ Remove an HTTP response header
-
requestHeader
(self, name: str) → str¶ Retrieve request header value
-
requestHeaders
(self) → Dict[str, str]¶ Returns the the Request headers
-
responseHeader
(self, name: str) → str¶ Retrieve response header value
-
responseHeaders
(self) → Dict[str, str]¶ Returns the response headers
-
sendResponse
(self)¶ Send out HTTP headers and flush output buffer
This method is intended only for streaming partial content.
-
setParameter
(self, key: str, value: str)¶ Sets a request parameter
-
setRequestHeader
(self, name: str, value: str)¶ Sets an HTTP request header
-
setResponseHeader
(self, name: str, value: str)¶ Sets an HTTP response header
-
setServiceException
(self, ex: QgsServerException)¶ Allow plugins to return a
QgsMapServiceException
-
setStatusCode
(self, code: int)¶ Sets response http status code
-
statusCode
(self) → int¶ Returns the response http status code
-
url
(self) → str¶ Returns the request url
-