This class implements simple http header management.
More...
#include <qgshttpheaders.h>
|
static const QString | KEY_REFERER = "referer" |
| Used in settings as the referer key. More...
|
|
static const QString | PARAM_PREFIX = "http-header:" |
| Used in uri to pass headers as params. More...
|
|
static const QString | PATH_PREFIX = "http-header/" |
| Used in settings as the group name. More...
|
|
This class implements simple http header management.
- Since
- QGIS 3.24
Definition at line 38 of file qgshttpheaders.h.
◆ QgsHttpHeaders() [1/5]
QgsHttpHeaders::QgsHttpHeaders |
( |
const QMap< QString, QVariant > & |
headers | ) |
|
◆ QgsHttpHeaders() [2/5]
QgsHttpHeaders::QgsHttpHeaders |
( |
| ) |
|
|
default |
◆ QgsHttpHeaders() [3/5]
QgsHttpHeaders::QgsHttpHeaders |
( |
const QgsSettings & |
settings, |
|
|
const QString & |
key = QString() |
|
) |
| |
◆ QgsHttpHeaders() [4/5]
QgsHttpHeaders::QgsHttpHeaders |
( |
const QString & |
key | ) |
|
◆ QgsHttpHeaders() [5/5]
QgsHttpHeaders::QgsHttpHeaders |
( |
const QDomElement & |
element | ) |
|
Constructor from a QDomElement element.
- Parameters
-
Definition at line 54 of file qgshttpheaders.cpp.
◆ ~QgsHttpHeaders()
QgsHttpHeaders::~QgsHttpHeaders |
( |
| ) |
|
|
virtualdefault |
◆ keys()
QList< QString > QgsHttpHeaders::keys |
( |
| ) |
const |
◆ operator=()
QgsHttpHeaders & QgsHttpHeaders::operator= |
( |
const QMap< QString, QVariant > & |
headers | ) |
|
◆ operator[]() [1/2]
QVariant & QgsHttpHeaders::operator[] |
( |
const QString & |
key | ) |
|
◆ operator[]() [2/2]
const QVariant QgsHttpHeaders::operator[] |
( |
const QString & |
key | ) |
const |
◆ sanitizeKey()
QString QgsHttpHeaders::sanitizeKey |
( |
const QString & |
key | ) |
const |
◆ setFromDomElement()
void QgsHttpHeaders::setFromDomElement |
( |
const QDomElement & |
element | ) |
|
Loads headers from the element.
key KEY_REFERER will be read from attribute "KEY_PREFIX+KEY_REFERER" and attribute "KEY_REFERER" (for backward compatibility)
- Parameters
-
Definition at line 209 of file qgshttpheaders.cpp.
◆ setFromMap()
void QgsHttpHeaders::setFromMap |
( |
const QVariantMap & |
map | ) |
|
Loads headers from the map.
key KEY_REFERER will be read from key "KEY_PREFIX+KEY_REFERER" and key "KEY_REFERER" (for backward compatibility)
- Parameters
-
Definition at line 190 of file qgshttpheaders.cpp.
◆ setFromSettings()
void QgsHttpHeaders::setFromSettings |
( |
const QgsSettings & |
settings, |
|
|
const QString & |
key = QString() |
|
) |
| |
Loads headers from the settings.
key KEY_REFERER will be read at path "key/PATH_PREFIX/KEY_REFERER" and path "key/KEY_REFERER" (for backward compatibility)
- Parameters
-
settings | |
key | sub group path |
Definition at line 140 of file qgshttpheaders.cpp.
◆ setFromUrlQuery()
void QgsHttpHeaders::setFromUrlQuery |
( |
const QUrlQuery & |
uri | ) |
|
◆ toSpacedString()
QString QgsHttpHeaders::toSpacedString |
( |
| ) |
const |
Returns key/value pairs as strings separated by space.
Definition at line 231 of file qgshttpheaders.cpp.
◆ updateDomElement()
bool QgsHttpHeaders::updateDomElement |
( |
QDomElement & |
el | ) |
const |
Updates a map by adding all the HTTP headers.
KEY_REFERER value will be available at attribute "KEY_PREFIX+KEY_REFERER" and attribute "KEY_REFERER" (for backward compatibility)
- Returns
true
if the update succeed
Definition at line 122 of file qgshttpheaders.cpp.
◆ updateMap()
bool QgsHttpHeaders::updateMap |
( |
QVariantMap & |
map | ) |
const |
Updates a map by adding all the HTTP headers.
KEY_REFERER value will be available at key "KEY_PREFIX+KEY_REFERER" and key "KEY_REFERER" (for backward compatibility)
- Returns
true
if the update succeed
Definition at line 107 of file qgshttpheaders.cpp.
◆ updateNetworkRequest()
bool QgsHttpHeaders::updateNetworkRequest |
( |
QNetworkRequest & |
request | ) |
const |
Updates a request by adding all the HTTP headers.
- Returns
true
if the update succeed
Definition at line 61 of file qgshttpheaders.cpp.
◆ updateSettings()
bool QgsHttpHeaders::updateSettings |
( |
QgsSettings & |
settings, |
|
|
const QString & |
key = QString() |
|
) |
| const |
Updates the settings by adding all the http headers in the path "key/PATH_PREFIX/".
KEY_REFERER value will be available at path "key/PATH_PREFIX/KEY_REFERER" and path "key/KEY_REFERER" (for backward compatibility)
- Parameters
-
settings | |
key | sub group path |
- Returns
true
if the update succeed
Definition at line 79 of file qgshttpheaders.cpp.
◆ updateUrlQuery()
bool QgsHttpHeaders::updateUrlQuery |
( |
QUrlQuery & |
uri | ) |
const |
Updates an uri by adding all the HTTP headers.
- Returns
true
if the update succeed
Definition at line 70 of file qgshttpheaders.cpp.
◆ KEY_REFERER
const QString QgsHttpHeaders::KEY_REFERER = "referer" |
|
static |
◆ PARAM_PREFIX
const QString QgsHttpHeaders::PARAM_PREFIX = "http-header:" |
|
static |
◆ PATH_PREFIX
const QString QgsHttpHeaders::PATH_PREFIX = "http-header/" |
|
static |
The documentation for this class was generated from the following files: