mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
254 lines
6.2 KiB
Plaintext
254 lines
6.2 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/server/qgsserverrequest.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsServerRequest
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsserverrequest.h"
|
|
%End
|
|
public:
|
|
static const QMetaObject staticMetaObject;
|
|
|
|
public:
|
|
|
|
typedef QMap<QString, QString> Parameters;
|
|
typedef QMap<QString, QString> Headers;
|
|
|
|
enum Method
|
|
{
|
|
HeadMethod,
|
|
PutMethod,
|
|
GetMethod,
|
|
PostMethod,
|
|
DeleteMethod,
|
|
PatchMethod
|
|
};
|
|
|
|
enum RequestHeader
|
|
{
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host
|
|
HOST,
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded
|
|
// https://tools.ietf.org/html/rfc7239
|
|
FORWARDED,
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
|
|
X_FORWARDED_FOR,
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host
|
|
X_FORWARDED_HOST,
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto
|
|
X_FORWARDED_PROTO,
|
|
// The QGIS service URL
|
|
X_QGIS_SERVICE_URL,
|
|
// The QGIS WMS service URL
|
|
X_QGIS_WMS_SERVICE_URL,
|
|
// The QGIS WFS service URL
|
|
X_QGIS_WFS_SERVICE_URL,
|
|
// The QGIS WCS service URL
|
|
X_QGIS_WCS_SERVICE_URL,
|
|
// The QGIS WMTS service URL
|
|
X_QGIS_WMTS_SERVICE_URL,
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
|
|
ACCEPT,
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
|
|
USER_AGENT,
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization
|
|
AUTHORIZATION,
|
|
};
|
|
|
|
QgsServerRequest();
|
|
|
|
QgsServerRequest( const QString &url, QgsServerRequest::Method method = QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers() );
|
|
%Docstring
|
|
Constructor
|
|
|
|
:param url: the url string
|
|
:param method: the request method
|
|
:param headers:
|
|
%End
|
|
|
|
QgsServerRequest( const QUrl &url, QgsServerRequest::Method method = QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers() );
|
|
%Docstring
|
|
Constructor
|
|
|
|
:param url: QUrl
|
|
:param method: the request method
|
|
:param headers:
|
|
%End
|
|
|
|
QgsServerRequest( const QgsServerRequest &other );
|
|
|
|
virtual ~QgsServerRequest();
|
|
|
|
static QString methodToString( const Method &method );
|
|
%Docstring
|
|
Returns a string representation of an HTTP request ``method``.
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
|
|
QUrl url() const;
|
|
%Docstring
|
|
|
|
:return: the request url as seen by QGIS server
|
|
|
|
.. seealso:: :py:func:`originalUrl`
|
|
server, by default the two are equal
|
|
%End
|
|
|
|
QgsServerRequest::Method method() const;
|
|
%Docstring
|
|
|
|
:return: the request method
|
|
%End
|
|
|
|
QgsServerRequest::Parameters parameters() const;
|
|
%Docstring
|
|
Returns a map of query parameters with keys converted
|
|
to uppercase
|
|
%End
|
|
|
|
QgsServerParameters serverParameters() const;
|
|
%Docstring
|
|
Returns parameters
|
|
%End
|
|
|
|
virtual void setParameter( const QString &key, const QString &value );
|
|
%Docstring
|
|
Set a parameter
|
|
%End
|
|
|
|
QString parameter( const QString &key, const QString &defaultValue = QString() ) const;
|
|
%Docstring
|
|
Gets a parameter value
|
|
%End
|
|
|
|
virtual void removeParameter( const QString &key );
|
|
%Docstring
|
|
Remove a parameter
|
|
%End
|
|
|
|
virtual QString header( const QString &name ) const;
|
|
%Docstring
|
|
Returns the header value
|
|
|
|
:param name: of the header
|
|
|
|
:return: the header value or an empty string
|
|
%End
|
|
|
|
virtual QString header( const RequestHeader &headerEnum ) const;
|
|
%Docstring
|
|
Returns the header value
|
|
|
|
:param headerEnum: of the header
|
|
|
|
:return: the header value or an empty string
|
|
%End
|
|
|
|
void setHeader( const QString &name, const QString &value );
|
|
%Docstring
|
|
Set an header
|
|
|
|
:param name:
|
|
:param value:
|
|
%End
|
|
|
|
QMap<QString, QString> headers() const;
|
|
%Docstring
|
|
Returns the header map
|
|
|
|
:return: the headers map
|
|
%End
|
|
|
|
void removeHeader( const QString &name );
|
|
%Docstring
|
|
Remove an header
|
|
|
|
:param name:
|
|
|
|
.. versionadded:: 3.20
|
|
%End
|
|
|
|
virtual QByteArray data() const;
|
|
%Docstring
|
|
Returns post/put data
|
|
Check for QByteArray.isNull() to check if data
|
|
is available.
|
|
%End
|
|
|
|
virtual void setUrl( const QUrl &url );
|
|
%Docstring
|
|
Set the request url
|
|
%End
|
|
|
|
QUrl originalUrl() const;
|
|
%Docstring
|
|
Returns the request url as seen by the web server,
|
|
by default this is equal to the url seen by QGIS server
|
|
|
|
.. seealso:: :py:func:`url`
|
|
|
|
.. versionadded:: 3.6
|
|
%End
|
|
|
|
QUrl baseUrl() const;
|
|
%Docstring
|
|
Returns the base URL of QGIS server
|
|
|
|
E.g. if we call QGIS server with 'http://example.com/folder?REQUEST=WMS&...'
|
|
the base URL will be 'http://example.com/folder'
|
|
|
|
.. versionadded:: 3.20
|
|
%End
|
|
|
|
void setMethod( QgsServerRequest::Method method );
|
|
%Docstring
|
|
Set the request method
|
|
%End
|
|
|
|
const QString queryParameter( const QString &name, const QString &defaultValue = QString( ) ) const;
|
|
%Docstring
|
|
Returns the query string parameter with the given ``name`` from the request URL, a ``defaultValue`` can be specified.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
protected:
|
|
|
|
void setOriginalUrl( const QUrl &url );
|
|
%Docstring
|
|
Set the request original ``url`` (the request url as seen by the web server)
|
|
|
|
.. seealso:: :py:func:`setUrl`
|
|
|
|
.. versionadded:: 3.6
|
|
%End
|
|
|
|
void setBaseUrl( const QUrl &url );
|
|
%Docstring
|
|
Set the base URL of QGIS server
|
|
|
|
.. versionadded:: 3.20
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/server/qgsserverrequest.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|