QGIS API Documentation  3.2.0-Bonn (bc43194)
Public Types | Public Member Functions | List of all members
QgsServerRequest Class Reference

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
}
 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
 
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...
 
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
 

Detailed Description

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

Since
QGIS 3.0

Definition at line 37 of file qgsserverrequest.h.

Member Typedef Documentation

◆ Headers

typedef QMap<QString, QString> QgsServerRequest::Headers

Definition at line 42 of file qgsserverrequest.h.

◆ Parameters

typedef QMap<QString, QString> QgsServerRequest::Parameters

Definition at line 41 of file qgsserverrequest.h.

Member Enumeration Documentation

◆ Method

HTTP Method (or equivalent) used for the request.

Enumerator
HeadMethod 
PutMethod 
GetMethod 
PostMethod 
DeleteMethod 

Definition at line 47 of file qgsserverrequest.h.

Constructor & Destructor Documentation

◆ QgsServerRequest() [1/3]

QgsServerRequest::QgsServerRequest ( )
default

Constructor.

◆ QgsServerRequest() [2/3]

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

◆ QgsServerRequest() [3/3]

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

Constructor.

Parameters
urlQUrl
methodthe request method
headers

◆ ~QgsServerRequest()

virtual QgsServerRequest::~QgsServerRequest ( )
virtualdefault

destructor

Member Function Documentation

◆ data()

virtual QByteArray QgsServerRequest::data ( ) const
virtual

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

◆ header()

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

Returns the header value.

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

◆ headers()

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

Returns the header map.

Returns
the headers map

◆ method()

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

◆ parameter()

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

Gets a parameter value.

◆ parameters()

QgsServerRequest::Parameters QgsServerRequest::parameters ( ) const

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

◆ removeHeader()

void QgsServerRequest::removeHeader ( const QString &  name)

Remove an header.

Parameters
name

◆ removeParameter()

void QgsServerRequest::removeParameter ( const QString &  key)

Remove a parameter.

◆ setHeader()

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

Set an header.

Parameters
name
value

◆ setMethod()

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

Set the request method.

◆ setParameter()

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

Set a parameter.

◆ setUrl()

void QgsServerRequest::setUrl ( const QUrl &  url)

Set the request url.

◆ url()

QUrl QgsServerRequest::url ( ) const
Returns
the request url

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