#include <thttprequest.h>
|
static QList< THttpRequest > | generate (QByteArray &byteArray, const QHostAddress &address, TActionContext *context) |
|
static QList< QPair< QString, QString > > | fromQuery (const QString &query) |
|
|
static bool | hasItem (const QString &name, const QList< QPair< QString, QString >> &items) |
|
static QString | itemValue (const QString &name, const QString &defaultValue, const QList< QPair< QString, QString >> &items) |
|
static QStringList | allItemValues (const QString &name, const QList< QPair< QString, QString >> &items) |
|
static QVariantList | itemVariantList (const QString &key, const QList< QPair< QString, QString >> &items) |
|
static QVariantMap | itemMap (const QList< QPair< QString, QString >> &items) |
|
static QVariantMap | itemMap (const QString &key, const QList< QPair< QString, QString >> &items) |
|
The THttpRequest class contains request information for HTTP.
◆ THttpRequest() [1/4]
THttpRequest::THttpRequest |
( |
| ) |
|
◆ THttpRequest() [2/4]
◆ THttpRequest() [3/4]
THttpRequest::THttpRequest |
( |
const THttpRequestHeader & |
header, |
|
|
const QByteArray & |
body, |
|
|
const QHostAddress & |
clientAddress, |
|
|
TActionContext * |
context |
|
) |
| |
Constructor with the header header and the body body.
◆ THttpRequest() [4/4]
THttpRequest::THttpRequest |
( |
const QByteArray & |
header, |
|
|
const QString & |
filePath, |
|
|
const QHostAddress & |
clientAddress, |
|
|
TActionContext * |
context |
|
) |
| |
Constructor with the header header and a body generated by reading the file filePath.
◆ ~THttpRequest()
THttpRequest::~THttpRequest |
( |
| ) |
|
|
virtual |
◆ allFormItemValues()
QStringList THttpRequest::allFormItemValues |
( |
const QString & |
name | ) |
const |
Returns the list of string value whose name is equal to name from the form data.
- See also
- QStringList formItemList()
◆ allItemValues()
QStringList THttpRequest::allItemValues |
( |
const QString & |
name, |
|
|
const QList< QPair< QString, QString >> & |
items |
|
) |
| |
|
staticprotected |
◆ allParameters()
QVariantMap THttpRequest::allParameters |
( |
| ) |
const |
Returns a map of all form data.
◆ allQueryItemValues()
QStringList THttpRequest::allQueryItemValues |
( |
const QString & |
name | ) |
const |
Returns the list of query string values whose name is equal to name from the URL.
- See also
- QStringList queryItemList()
◆ boundary()
QByteArray THttpRequest::boundary |
( |
| ) |
const |
|
protected |
Returns the boundary of multipart/form-data.
◆ clientAddress()
QHostAddress THttpRequest::clientAddress |
( |
| ) |
const |
|
inline |
Returns the address of the client host.
◆ cookie()
QByteArray THttpRequest::cookie |
( |
const QString & |
name | ) |
const |
Returns the cookie associated with the name.
◆ cookies()
QList< TCookie > THttpRequest::cookies |
( |
| ) |
const |
◆ formItemList()
QStringList THttpRequest::formItemList |
( |
const QString & |
key | ) |
const |
Returns the list of string value whose key is equal to key, such as "foo[]", from the form data.
- See also
- QStringList allFormItemValues()
◆ formItems() [1/2]
QVariantMap THttpRequest::formItems |
( |
| ) |
const |
Returns the map of all form data.
◆ formItems() [2/2]
QVariantMap THttpRequest::formItems |
( |
const QString & |
key | ) |
const |
Returns the map of variant value whose key is equal to key from the form data.
◆ formItemValue() [1/2]
QString THttpRequest::formItemValue |
( |
const QString & |
name | ) |
const |
Returns the string value whose name is equal to name from the form data.
◆ formItemValue() [2/2]
QString THttpRequest::formItemValue |
( |
const QString & |
name, |
|
|
const QString & |
defaultValue |
|
) |
| const |
This is an overloaded function.
Returns the string value whose name is equal to name from the form data. If the form data contains no item with the given name, the function returns defaultValue.
◆ formItemVariantList()
QVariantList THttpRequest::formItemVariantList |
( |
const QString & |
key | ) |
const |
Returns the list of QVariant value whose key is equal to key, such as "foo[]", from the form data.
◆ fromQuery()
QList< QPair< QString, QString > > THttpRequest::fromQuery |
( |
const QString & |
query | ) |
|
|
static |
◆ generate()
QList< THttpRequest > THttpRequest::generate |
( |
QByteArray & |
byteArray, |
|
|
const QHostAddress & |
address, |
|
|
TActionContext * |
context |
|
) |
| |
|
static |
◆ getHttpMethodOverride()
Returns a method value of X-HTTP methods override for REST API.
◆ hasForm()
bool THttpRequest::hasForm |
( |
| ) |
const |
|
inline |
Returns true if the request contains form data.
◆ hasFormItem()
bool THttpRequest::hasFormItem |
( |
const QString & |
name | ) |
const |
Returns true if there is a string pair whose name is equal to name from the form data.
◆ hasItem()
bool THttpRequest::hasItem |
( |
const QString & |
name, |
|
|
const QList< QPair< QString, QString >> & |
items |
|
) |
| |
|
staticprotected |
◆ hasJson()
bool THttpRequest::hasJson |
( |
| ) |
const |
|
inline |
Returns true if the request contains JSON data.
◆ hasQuery()
bool THttpRequest::hasQuery |
( |
| ) |
const |
|
inline |
Returns true if the URL contains a Query.
◆ hasQueryItem()
bool THttpRequest::hasQueryItem |
( |
const QString & |
name | ) |
const |
Returns true if there is a query string pair whose name is equal to name from the URL.
◆ header()
Returns the HTTP header of the request.
◆ itemMap() [1/2]
QVariantMap THttpRequest::itemMap |
( |
const QList< QPair< QString, QString >> & |
items | ) |
|
|
staticprotected |
◆ itemMap() [2/2]
QVariantMap THttpRequest::itemMap |
( |
const QString & |
key, |
|
|
const QList< QPair< QString, QString >> & |
items |
|
) |
| |
|
staticprotected |
◆ itemValue()
QString THttpRequest::itemValue |
( |
const QString & |
name, |
|
|
const QString & |
defaultValue, |
|
|
const QList< QPair< QString, QString >> & |
items |
|
) |
| |
|
staticprotected |
◆ itemVariantList()
QVariantList THttpRequest::itemVariantList |
( |
const QString & |
key, |
|
|
const QList< QPair< QString, QString >> & |
items |
|
) |
| |
|
staticprotected |
◆ jsonData()
const QJsonDocument & THttpRequest::jsonData |
( |
| ) |
const |
|
inline |
Return the JSON data contained in the request.
◆ method()
Returns the method of an HTTP request, which can be overridden by another value, a query parameter named '_method' or X-HTTP-Method-Override header, etc.
- See also
- THttpRequest::realMethod()
-
EnableHttpMethodOverride of application.ini
◆ multipartFormData()
Returns a object of multipart/form-data.
◆ operator=()
◆ originatingClientAddress()
QHostAddress THttpRequest::originatingClientAddress |
( |
| ) |
const |
Returns a originating IP address of the client by parsing the 'X-Forwarded-For' header of the request.
To enable this feature, edit application.ini and set the 'EnableForwardedForHeader' parameter to true and the 'TrustedProxyServers' parameter to IP addresses of the proxy servers.
◆ parameter()
QString THttpRequest::parameter |
( |
const QString & |
name | ) |
const |
Returns the string value whose name is equal to name from the URL or the form data.
◆ queryItemList()
QStringList THttpRequest::queryItemList |
( |
const QString & |
key | ) |
const |
◆ queryItemMethod()
Returns a method value as a query parameter named '_method' for REST API.
◆ queryItems() [1/2]
QVariantMap THttpRequest::queryItems |
( |
| ) |
const |
Returns the query string of the URL, as a map of keys and values.
◆ queryItems() [2/2]
QVariantMap THttpRequest::queryItems |
( |
const QString & |
key | ) |
const |
Returns the map of query value whose key is equal to key from the URL.
◆ queryItemValue() [1/2]
QString THttpRequest::queryItemValue |
( |
const QString & |
name | ) |
const |
Returns the query string value whose name is equal to name from the URL.
◆ queryItemValue() [2/2]
QString THttpRequest::queryItemValue |
( |
const QString & |
name, |
|
|
const QString & |
defaultValue |
|
) |
| const |
This is an overloaded function.
Returns the query string value whose name is equal to name from the URL. If the query string contains no item with the given name, the function returns defaultValue.
◆ queryItemVariantList()
QVariantList THttpRequest::queryItemVariantList |
( |
const QString & |
key | ) |
const |
Returns the list of query value whose key is equal to key, such as "foo[]", from the URL.
◆ rawBody()
QIODevice * THttpRequest::rawBody |
( |
| ) |
|
◆ realMethod()
◆ TMultipartFormData
The documentation for this class was generated from the following files: