mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
241 lines
5.6 KiB
Plaintext
241 lines
5.6 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
|
|
{
|
|
%Docstring(signature="appended")
|
|
:py:class:`QgsServerRequest`
|
|
Class defining request interface passed to services :py:func:`QgsService.executeRequest()` method
|
|
%End
|
|
|
|
%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
|
|
{
|
|
|
|
HOST,
|
|
FORWARDED,
|
|
X_FORWARDED_FOR,
|
|
X_FORWARDED_HOST,
|
|
X_FORWARDED_PROTO,
|
|
X_QGIS_SERVICE_URL,
|
|
X_QGIS_WMS_SERVICE_URL,
|
|
X_QGIS_WFS_SERVICE_URL,
|
|
X_QGIS_WCS_SERVICE_URL,
|
|
X_QGIS_WMTS_SERVICE_URL,
|
|
ACCEPT,
|
|
USER_AGENT,
|
|
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` for the unrewritten url as seen by the web 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` for the rewritten 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` for the rewritten url
|
|
|
|
.. 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 *
|
|
************************************************************************/
|