20#ifndef QGSREQUESTHANDLER_H
21#define QGSREQUESTHANDLER_H
23#include "qgis_server.h"
96 QByteArray
body()
const;
99 QByteArray
data()
const;
108 QString
path()
const;
125 void setParameter(
const QString &key,
const QString &value );
128 QString
parameter(
const QString &key )
const;
140 QString
format()
const {
return mFormat; }
143 bool headersSent()
const;
150 void setupParameters();
154 QString mFormatString;
156 bool mExceptionRaised =
false;
An interface hiding the details of reading input and writing output from/to a wms request mechanism.
void removeParameter(const QString &key)
Remove a request parameter.
void removeRequestHeader(const QString &name)
Remove an HTTP request header.
QString responseHeader(const QString &name) const
Retrieve response header value.
void clearBody()
Clear response buffer.
QString requestHeader(const QString &name) const
Retrieve request header value.
QMap< QString, QString > parameterMap() const
Returns the parsed parameters as a key-value pair.
QString path() const
Returns the path component of the request URL.
QByteArray data() const
Returns the request POST data (can be null).
QString format() const
Returns the requested format string.
bool exceptionRaised() const
Pointer to last raised exception.
void parseInput()
Parses the input and creates a request neutral Parameter/Value map.
void setServiceException(const QgsServerException &ex)
Allow plugins to return a QgsMapServiceException.
void removeResponseHeader(const QString &name)
Remove an HTTP response header.
void sendResponse()
Send out HTTP headers and flush output buffer.
QMap< QString, QString > responseHeaders() const
Returns the response headers.
void setRequestHeader(const QString &name, const QString &value)
Sets an HTTP request header.
void appendBody(const QByteArray &body)
Sets the info format string such as "text/xml".
QString parameter(const QString &key) const
Returns a request parameter.
QMap< QString, QString > requestHeaders() const
Returns the the Request headers.
QString url() const
Returns the request url.
void setStatusCode(int code)
Sets response http status code.
QgsRequestHandler(QgsServerRequest &request, QgsServerResponse &response)
Constructor.
QByteArray body() const
Returns the response body data.
void clear()
Clears the response body and headers.
void setResponseHeader(const QString &name, const QString &value)
Sets an HTTP response header.
int statusCode() const
Returns the response http status code.
void setParameter(const QString &key, const QString &value)
Sets a request parameter.
Exception base class for server exceptions.
Defines requests passed to QgsService classes.
Defines the response interface passed to QgsService.