20#ifndef QGSREQUESTHANDLER_H
21#define QGSREQUESTHANDLER_H
23#include "qgis_server.h"
111 QByteArray
body()
const;
114 QByteArray
data()
const;
123 QString
path()
const;
140 void setParameter(
const QString &key,
const QString &value );
143 QString
parameter(
const QString &key )
const;
155 QString
format()
const {
return mFormat; }
158 bool headersSent()
const;
165 void setupParameters();
169 QString mFormatString;
171 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.
Q_DECL_DEPRECATED QMap< QString, QString > responseHeaders() const
Returns the response headers: note that if multiple values are set for the same header,...
void setRequestHeader(const QString &name, const QString &value)
Sets an HTTP request header.
QMap< QString, QList< QString > > fullResponseHeaders() const
Returns the response headers as a map of header name to list of values (to support multiple values fo...
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 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.
QList< QString > fullResponseHeader(const QString &name) const
Returns the list of response headers for a given header name.
Exception base class for server exceptions.
Defines requests passed to QgsService classes.
Defines the response interface passed to QgsService.