QGIS API Documentation
3.18.1-Zürich (202f1bf7e5)
|
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() method. More...
#include <qgsserverrequest.h>
Public Types | |
typedef QMap< QString, QString > | Headers |
enum | Method { HeadMethod , PutMethod , GetMethod , PostMethod , DeleteMethod , PatchMethod } |
HTTP Method (or equivalent) used for the request. More... | |
typedef QMap< QString, QString > | Parameters |
Public Member Functions | |
QgsServerRequest ()=default | |
Constructor. More... | |
QgsServerRequest (const QString &url, QgsServerRequest::Method method=QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers=QgsServerRequest::Headers()) | |
Constructor. More... | |
QgsServerRequest (const QUrl &url, QgsServerRequest::Method method=QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers=QgsServerRequest::Headers()) | |
Constructor. More... | |
virtual | ~QgsServerRequest ()=default |
destructor More... | |
virtual QByteArray | data () const |
Returns post/put data Check for QByteArray::isNull() to check if data is available. More... | |
QString | header (const QString &name) const |
Returns the header value. More... | |
QMap< QString, QString > | headers () const |
Returns the header map. More... | |
QgsServerRequest::Method | method () const |
QUrl | originalUrl () const |
Returns the request url as seen by the web server, by default this is equal to the url seen by QGIS server. More... | |
QString | parameter (const QString &key, const QString &defaultValue=QString()) const |
Gets a parameter value. More... | |
QgsServerRequest::Parameters | parameters () const |
Returns a map of query parameters with keys converted to uppercase. More... | |
const QString | queryParameter (const QString &name, const QString &defaultValue=QString()) const |
Returns the query string parameter with the given name from the request URL, a defaultValue can be specified. More... | |
void | removeHeader (const QString &name) |
Remove an header. More... | |
void | removeParameter (const QString &key) |
Remove a parameter. More... | |
QgsServerParameters | serverParameters () const |
Returns parameters. More... | |
void | setHeader (const QString &name, const QString &value) |
Set an header. More... | |
void | setMethod (QgsServerRequest::Method method) |
Set the request method. More... | |
void | setParameter (const QString &key, const QString &value) |
Set a parameter. More... | |
void | setUrl (const QUrl &url) |
Set the request url. More... | |
QUrl | url () const |
Static Public Member Functions | |
static QString | methodToString (const Method &method) |
Returns a string representation of an HTTP request method. More... | |
Protected Member Functions | |
void | setOriginalUrl (const QUrl &url) |
Set the request original url (the request url as seen by the web server) More... | |
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() method.
Definition at line 38 of file qgsserverrequest.h.
typedef QMap<QString, QString> QgsServerRequest::Headers |
Definition at line 45 of file qgsserverrequest.h.
typedef QMap<QString, QString> QgsServerRequest::Parameters |
Definition at line 44 of file qgsserverrequest.h.
HTTP Method (or equivalent) used for the request.
Enumerator | |
---|---|
HeadMethod | |
PutMethod | |
GetMethod | |
PostMethod | |
DeleteMethod | |
PatchMethod |
Definition at line 50 of file qgsserverrequest.h.
|
default |
Constructor.
QgsServerRequest::QgsServerRequest | ( | const QString & | url, |
QgsServerRequest::Method | method = QgsServerRequest::GetMethod , |
||
const QgsServerRequest::Headers & | headers = QgsServerRequest::Headers() |
||
) |
Constructor.
url | the url string |
method | the request method |
headers |
Definition at line 23 of file qgsserverrequest.cpp.
QgsServerRequest::QgsServerRequest | ( | const QUrl & | url, |
QgsServerRequest::Method | method = QgsServerRequest::GetMethod , |
||
const QgsServerRequest::Headers & | headers = QgsServerRequest::Headers() |
||
) |
Constructor.
url | QUrl |
method | the request method |
headers |
Definition at line 28 of file qgsserverrequest.cpp.
|
virtualdefault |
destructor
|
virtual |
Returns post/put data Check for QByteArray::isNull() to check if data is available.
Reimplemented in QgsFcgiServerRequest, and QgsBufferServerRequest.
Definition at line 95 of file qgsserverrequest.cpp.
QString QgsServerRequest::header | ( | const QString & | name | ) | const |
Returns the header value.
name | of the header |
Definition at line 43 of file qgsserverrequest.cpp.
QMap< QString, QString > QgsServerRequest::headers | ( | ) | const |
QgsServerRequest::Method QgsServerRequest::method | ( | ) | const |
Definition at line 80 of file qgsserverrequest.cpp.
|
static |
Returns a string representation of an HTTP request method.
Definition at line 37 of file qgsserverrequest.cpp.
QUrl QgsServerRequest::originalUrl | ( | ) | const |
Returns the request url as seen by the web server, by default this is equal to the url seen by QGIS server.
Definition at line 70 of file qgsserverrequest.cpp.
QString QgsServerRequest::parameter | ( | const QString & | key, |
const QString & | defaultValue = QString() |
||
) | const |
Gets a parameter value.
Definition at line 106 of file qgsserverrequest.cpp.
QMap< QString, QString > QgsServerRequest::parameters | ( | ) | const |
Returns a map of query parameters with keys converted to uppercase.
Definition at line 85 of file qgsserverrequest.cpp.
const QString QgsServerRequest::queryParameter | ( | const QString & | name, |
const QString & | defaultValue = QString( ) |
||
) | const |
Returns the query string parameter with the given name from the request URL, a defaultValue can be specified.
Definition at line 134 of file qgsserverrequest.cpp.
void QgsServerRequest::removeHeader | ( | const QString & | name | ) |
void QgsServerRequest::removeParameter | ( | const QString & | key | ) |
Remove a parameter.
Definition at line 116 of file qgsserverrequest.cpp.
QgsServerParameters QgsServerRequest::serverParameters | ( | ) | const |
Returns parameters.
Definition at line 90 of file qgsserverrequest.cpp.
void QgsServerRequest::setHeader | ( | const QString & | name, |
const QString & | value | ||
) |
void QgsServerRequest::setMethod | ( | QgsServerRequest::Method | method | ) |
Set the request method.
Definition at line 129 of file qgsserverrequest.cpp.
|
protected |
Set the request original url (the request url as seen by the web server)
Definition at line 75 of file qgsserverrequest.cpp.
void QgsServerRequest::setParameter | ( | const QString & | key, |
const QString & | value | ||
) |
Set a parameter.
Definition at line 100 of file qgsserverrequest.cpp.
void QgsServerRequest::setUrl | ( | const QUrl & | url | ) |
Set the request url.
Definition at line 122 of file qgsserverrequest.cpp.
QUrl QgsServerRequest::url | ( | ) | const |
Definition at line 65 of file qgsserverrequest.cpp.