19#ifndef QGSSERVERREQUEST_H
20#define QGSSERVERREQUEST_H
22#include "qgis_server.h"
77 Q_ENUM( RequestHeader )
137 virtual
void setParameter( const QString &key, const QString &value );
142 QString
parameter( const QString &key, const QString &defaultValue = QString() ) const;
154 virtual QString
header( const QString &name ) const;
168 void setHeader( const QString &name, const QString &value );
174 QMap<QString, QString>
headers() const;
188 virtual QByteArray
data() const;
223 const QString
queryParameter( const QString &name, const QString &defaultValue = QString() ) const;
Provides an interface to retrieve and manipulate global parameters received from the client.
void setOriginalUrl(const QUrl &url)
Set the request original url (the request url as seen by the web server).
Method
HTTP Method (or equivalent) used for the request.
QgsServerParameters serverParameters() const
Returns parameters.
const QString queryParameter(const QString &name, const QString &defaultValue=QString()) const
Returns the query string parameter with the given name from the request URL, a defaultValue can be sp...
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
virtual QString header(const QString &name) const
Returns the header value.
QString parameter(const QString &key, const QString &defaultValue=QString()) const
Gets a parameter value.
virtual void setParameter(const QString &key, const QString &value)
Set a parameter.
QgsServerRequest()=default
virtual void setUrl(const QUrl &url)
Set the request url.
QUrl url() const
Returns the request URL as seen by QGIS server.
QMap< QString, QString > headers() const
Returns the header map.
QUrl baseUrl() const
Returns the base URL of QGIS server.
QMap< QString, QString > Parameters
QgsServerRequest::Method method() const
Returns the request method.
QUrl originalUrl() const
Returns the request url as seen by the web server, by default this is equal to the url seen by QGIS s...
void setMethod(QgsServerRequest::Method method)
Set the request method.
void removeHeader(const QString &name)
Remove an header.
QMap< QString, QString > Headers
virtual void removeParameter(const QString &key)
Remove a parameter.
void setBaseUrl(const QUrl &url)
Set the base URL of QGIS server.
void setHeader(const QString &name, const QString &value)
Set an header.
RequestHeader
The internal HTTP Header used for the request as enum.
@ X_QGIS_WMS_SERVICE_URL
The QGIS WMS service URL.
@ ACCEPT
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept.
@ X_QGIS_WCS_SERVICE_URL
The QGIS WCS service URL.
@ USER_AGENT
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent.
@ X_QGIS_WFS_SERVICE_URL
The QGIS WFS service URL.
@ X_FORWARDED_FOR
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For.
@ X_FORWARDED_PROTO
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto.
@ X_QGIS_WMTS_SERVICE_URL
The QGIS WMTS service URL.
@ X_QGIS_SERVICE_URL
The QGIS service URL.
@ X_FORWARDED_HOST
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host.
@ FORWARDED
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded, https://tools....
@ HOST
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host.
@ AUTHORIZATION
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization.
static QString methodToString(const Method &method)
Returns a string representation of an HTTP request method.
virtual QByteArray data() const
Returns post/put data Check for QByteArray::isNull() to check if data is available.