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

This class is an interface hiding the details of reading input and writing output from/to a wms request mechanism. More...

#include <qgsrequesthandler.h>

Public Member Functions

 QgsRequestHandler (QgsServerRequest &request, QgsServerResponse &response)
 Constructor. More...
 
void appendBody (const QByteArray &body)
 Sets the info format string such as "text/xml". More...
 
QByteArray body () const
 Returns the response body data. More...
 
void clear ()
 Clears the response body and headers. More...
 
void clearBody ()
 Clear response buffer. More...
 
QByteArray data () const
 Returns the request POST data (can be null) More...
 
bool exceptionRaised () const
 Pointer to last raised exception. More...
 
QString format () const
 Returns the requested format string. More...
 
bool headersSent () const
 Returns true if the HTTP headers were already sent to the client. More...
 
QString parameter (const QString &key) const
 Returns a request parameter. More...
 
QMap< QString, QString > parameterMap () const
 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. More...
 
void parseInput ()
 Parses the input and creates a request neutral Parameter/Value map. More...
 
void removeParameter (const QString &key)
 Remove a request parameter. More...
 
void removeRequestHeader (const QString &name)
 Remove an HTTP request header. More...
 
void removeResponseHeader (const QString &name)
 Remove an HTTP response header. More...
 
QString requestHeader (const QString &name) const
 Retrieve request header value. More...
 
QMap< QString, QString > requestHeaders () const
 Returns the the Request headers. More...
 
QString responseHeader (const QString &name) const
 Retrieve response header value. More...
 
QMap< QString, QString > responseHeaders () const
 Returns the response headers. More...
 
void sendResponse ()
 Send out HTTP headers and flush output buffer. More...
 
void setParameter (const QString &key, const QString &value)
 Sets a request parameter. More...
 
void setRequestHeader (const QString &name, const QString &value)
 Sets an HTTP request header. More...
 
void setResponseHeader (const QString &name, const QString &value)
 Sets an HTTP response header. More...
 
void setServiceException (const QgsServerException &ex)
 Allow plugins to return a QgsMapServiceException. More...
 
void setStatusCode (int code)
 Sets response http status code. More...
 
int statusCode () const
 Returns the response http status code. More...
 
QString url () const
 Returns the request url. More...
 

Detailed Description

This class is an interface hiding the details of reading input and writing output from/to a wms request mechanism.

Definition at line 47 of file qgsrequesthandler.h.

Constructor & Destructor Documentation

◆ QgsRequestHandler()

QgsRequestHandler::QgsRequestHandler ( QgsServerRequest request,
QgsServerResponse response 
)
explicit

Constructor.

Note that QgsServerRequest and QgsServerResponse MUST live in the same scope

Member Function Documentation

◆ appendBody()

void QgsRequestHandler::appendBody ( const QByteArray &  body)

Sets the info format string such as "text/xml".

◆ body()

QByteArray QgsRequestHandler::body ( ) const

Returns the response body data.

◆ clear()

void QgsRequestHandler::clear ( )

Clears the response body and headers.

◆ clearBody()

void QgsRequestHandler::clearBody ( )

Clear response buffer.

◆ data()

QByteArray QgsRequestHandler::data ( ) const

Returns the request POST data (can be null)

◆ exceptionRaised()

bool QgsRequestHandler::exceptionRaised ( ) const

Pointer to last raised exception.

◆ format()

QString QgsRequestHandler::format ( ) const
inline

Returns the requested format string.

Definition at line 143 of file qgsrequesthandler.h.

◆ headersSent()

bool QgsRequestHandler::headersSent ( ) const

Returns true if the HTTP headers were already sent to the client.

◆ parameter()

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

Returns a request parameter.

◆ parameterMap()

QMap<QString, QString> QgsRequestHandler::parameterMap ( ) const

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.

◆ parseInput()

void QgsRequestHandler::parseInput ( )

Parses the input and creates a request neutral Parameter/Value map.

Note
not available in Python bindings

◆ removeParameter()

void QgsRequestHandler::removeParameter ( const QString &  key)

Remove a request parameter.

◆ removeRequestHeader()

void QgsRequestHandler::removeRequestHeader ( const QString &  name)

Remove an HTTP request header.

◆ removeResponseHeader()

void QgsRequestHandler::removeResponseHeader ( const QString &  name)

Remove an HTTP response header.

◆ requestHeader()

QString QgsRequestHandler::requestHeader ( const QString &  name) const

Retrieve request header value.

◆ requestHeaders()

QMap<QString, QString> QgsRequestHandler::requestHeaders ( ) const

Returns the the Request headers.

◆ responseHeader()

QString QgsRequestHandler::responseHeader ( const QString &  name) const

Retrieve response header value.

◆ responseHeaders()

QMap<QString, QString> QgsRequestHandler::responseHeaders ( ) const

Returns the response headers.

◆ sendResponse()

void QgsRequestHandler::sendResponse ( )

Send out HTTP headers and flush output buffer.

This method is intended only for streaming partial content.

◆ setParameter()

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

Sets a request parameter.

◆ setRequestHeader()

void QgsRequestHandler::setRequestHeader ( const QString &  name,
const QString &  value 
)

Sets an HTTP request header.

◆ setResponseHeader()

void QgsRequestHandler::setResponseHeader ( const QString &  name,
const QString &  value 
)

Sets an HTTP response header.

◆ setServiceException()

void QgsRequestHandler::setServiceException ( const QgsServerException ex)

Allow plugins to return a QgsMapServiceException.

◆ setStatusCode()

void QgsRequestHandler::setStatusCode ( int  code)

Sets response http status code.

◆ statusCode()

int QgsRequestHandler::statusCode ( ) const

Returns the response http status code.

◆ url()

QString QgsRequestHandler::url ( ) const

Returns the request url.


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