QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Types | Public Member Functions | Protected Member Functions | List of all members
QgsServerRequest Class Reference

QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() method. More...

#include <qgsserverrequest.h>

Inheritance diagram for QgsServerRequest:
Inheritance graph
[legend]

Public Types

typedef QMap< QString, QString > Headers
 
enum  Method {
  HeadMethod, PutMethod, GetMethod, PostMethod,
  DeleteMethod
}
 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
 Gets a parameter value. More...
 
QgsServerRequest::Parameters parameters () const
 Returns a map of query parameters with keys converted to uppercase. 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
 

Protected Member Functions

void setOriginalUrl (const QUrl &url)
 Set the request original url (the request url as seen by the web server) More...
 

Detailed Description

QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() method.

Since
QGIS 3.0

Definition at line 38 of file qgsserverrequest.h.

Member Typedef Documentation

typedef QMap<QString, QString> QgsServerRequest::Headers

Definition at line 43 of file qgsserverrequest.h.

typedef QMap<QString, QString> QgsServerRequest::Parameters

Definition at line 42 of file qgsserverrequest.h.

Member Enumeration Documentation

HTTP Method (or equivalent) used for the request.

Enumerator
HeadMethod 
PutMethod 
GetMethod 
PostMethod 
DeleteMethod 

Definition at line 48 of file qgsserverrequest.h.

Constructor & Destructor Documentation

QgsServerRequest::QgsServerRequest ( )
default

Constructor.

QgsServerRequest::QgsServerRequest ( const QString &  url,
QgsServerRequest::Method  method = QgsServerRequest::GetMethod,
const QgsServerRequest::Headers headers = QgsServerRequest::Headers() 
)

Constructor.

Parameters
urlthe url string
methodthe 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.

Parameters
urlQUrl
methodthe request method
headers

Definition at line 28 of file qgsserverrequest.cpp.

virtual QgsServerRequest::~QgsServerRequest ( )
virtualdefault

destructor

Member Function Documentation

QByteArray QgsServerRequest::data ( ) const
virtual

Returns post/put data Check for QByteArray::isNull() to check if data is available.

Reimplemented in QgsBufferServerRequest, and QgsFcgiServerRequest.

Definition at line 89 of file qgsserverrequest.cpp.

QString QgsServerRequest::header ( const QString &  name) const

Returns the header value.

Parameters
nameof the header
Returns
the header value or an empty string

Definition at line 37 of file qgsserverrequest.cpp.

QMap< QString, QString > QgsServerRequest::headers ( ) const

Returns the header map.

Returns
the headers map

Definition at line 48 of file qgsserverrequest.cpp.

QgsServerRequest::Method QgsServerRequest::method ( ) const
Returns
the request method

Definition at line 74 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.

See also
url() for the rewritten url
Since
QGIS 3.6

Definition at line 64 of file qgsserverrequest.cpp.

QString QgsServerRequest::parameter ( const QString &  key) const

Gets a parameter value.

Definition at line 100 of file qgsserverrequest.cpp.

QMap< QString, QString > QgsServerRequest::parameters ( ) const

Returns a map of query parameters with keys converted to uppercase.

Definition at line 79 of file qgsserverrequest.cpp.

void QgsServerRequest::removeHeader ( const QString &  name)

Remove an header.

Parameters
name

Definition at line 54 of file qgsserverrequest.cpp.

void QgsServerRequest::removeParameter ( const QString &  key)

Remove a parameter.

Definition at line 105 of file qgsserverrequest.cpp.

QgsServerParameters QgsServerRequest::serverParameters ( ) const

Returns parameters.

Definition at line 84 of file qgsserverrequest.cpp.

void QgsServerRequest::setHeader ( const QString &  name,
const QString &  value 
)

Set an header.

Parameters
name
value

Definition at line 43 of file qgsserverrequest.cpp.

void QgsServerRequest::setMethod ( QgsServerRequest::Method  method)

Set the request method.

Definition at line 118 of file qgsserverrequest.cpp.

void QgsServerRequest::setOriginalUrl ( const QUrl &  url)
protected

Set the request original url (the request url as seen by the web server)

See also
setUrl() for the rewritten url
Since
QGIS 3.6

Definition at line 69 of file qgsserverrequest.cpp.

void QgsServerRequest::setParameter ( const QString &  key,
const QString &  value 
)

Set a parameter.

Definition at line 94 of file qgsserverrequest.cpp.

void QgsServerRequest::setUrl ( const QUrl &  url)

Set the request url.

Definition at line 111 of file qgsserverrequest.cpp.

QUrl QgsServerRequest::url ( ) const
Returns
the request url as seen by QGIS server
See also
originalUrl for the unrewritten url as seen by the web server library, by default the two are equal

Definition at line 59 of file qgsserverrequest.cpp.


The documentation for this class was generated from the following files: