|
RestLink 2.2.0
Powerfull Rest Client for Qt
|
A class for storing and managing some HTTP request informations (url path and query parameter along with headers). More...
#include <requestinterface.h>
Inherited by RestLink::ApiBase, and RestLink::Request.
Public Member Functions | |
| bool | hasPathParameter (const QString &name) const |
| Checks if a path parameter exists in the request. | |
| PathParameter | pathParameter (const QString &name) const |
| Retrieves a specific path parameter. | |
| QVariant | pathParameterValue (const QString &name) const |
| Retrieves the value of a path parameter. | |
| QStringList | pathParameterNames () const |
| Retrieves the names of all path parameters. | |
| void | setPathParameter (const QString &name, const QVariant &value) |
| Sets the value of a path parameter. | |
| void | setPathParameter (const PathParameter ¶meter) |
Sets a path parameter using a PathParameter object. | |
| void | unsetPathParameter (const QString &name) |
| Unsets (removes) a path parameter from the request. | |
| QList< PathParameter > | pathParameters () const |
| Retrieves all path parameters. | |
| void | setPathParameters (const QList< PathParameter > ¶meters) |
| Sets all path parameters. | |
| bool | hasQueryParameter (const QString &name) const |
| Checks if a query parameter exists in the request. | |
| QueryParameter | queryParameter (const QString &name) const |
| Retrieves a specific query parameter. | |
| QList< QVariant > | queryParameterValues (const QString &name) const |
| Retrieves the values of a query parameter. | |
| QStringList | queryParameterNames () const |
| Retrieves the names of all query parameters. | |
| void | addQueryParameter (const QString &name, const QVariant &value) |
| Add the value of a query parameter. | |
| void | addQueryParameter (const QueryParameter ¶m) |
Add query parameter using a QueryParameter object. | |
| void | removeQueryParameter (const QString &name) |
| Removes a query parameter from the request. | |
| void | removeQueryParameter (const QString &name, const QVariant &value) |
| Removes a query parameter from the request. | |
| QList< QueryParameter > | queryParameters () const |
| Retrieves all query parameters. | |
| void | setQueryParameters (const QList< QueryParameter > ¶meters) |
| Sets all query parameters. | |
| bool | hasHeader (const QString &name) const |
| Checks if a header exists in the request. | |
| Header | header (const QString &name) const |
| Retrieves a specific header. | |
| QList< QVariant > | headerValues (const QString &name) const |
| Retrieves the values of a header. | |
| QStringList | headerNames () const |
| Retrieves the names of all headers. | |
| void | setHeader (const QString &name, const QVariant &value) |
| Sets the value of a header. | |
| void | setHeader (const Header &header) |
Sets a header using a Header object. | |
| void | unsetHeader (const QString &name) |
| Unsets (removes) a header from the request. | |
| QList< Header > | headers () const |
| Retrieves all headers. | |
| void | setHeaders (const QList< Header > &headers) |
| Sets all headers. | |
Protected Member Functions | |
| virtual const QList< PathParameter > * | constPathParameters () const =0 |
| virtual QList< PathParameter > * | mutablePathParameters ()=0 |
| virtual const QList< QueryParameter > * | constQueryParameters () const =0 |
| virtual QList< QueryParameter > * | mutableQueryParameters ()=0 |
| virtual const QList< Header > * | constHeaders () const =0 |
| virtual QList< Header > * | mutableHeaders ()=0 |
A class for storing and managing some HTTP request informations (url path and query parameter along with headers).
| bool RestLink::RequestInterface::hasPathParameter | ( | const QString & | name | ) | const |
Checks if a path parameter exists in the request.
This function checks whether a path parameter with the given name exists.
| name | The name of the path parameter. |
| PathParameter RestLink::RequestInterface::pathParameter | ( | const QString & | name | ) | const |
Retrieves a specific path parameter.
This function retrieves the path parameter for the given name. If the parameter is not found, it returns a default-constructed PathParameter.
| name | The name of the path parameter. |
| QVariant RestLink::RequestInterface::pathParameterValue | ( | const QString & | name | ) | const |
Retrieves the value of a path parameter.
This function returns the value associated with the given path parameter name. If the parameter is not found, an empty QVariant is returned.
| name | The name of the path parameter. |
| QStringList RestLink::RequestInterface::pathParameterNames | ( | ) | const |
Retrieves the names of all path parameters.
This function returns a list of names of all the path parameters in the request.
| void RestLink::RequestInterface::setPathParameter | ( | const QString & | name, |
| const QVariant & | value | ||
| ) |
Sets the value of a path parameter.
This function sets or updates the value of a path parameter in the request. If the parameter does not exist, it is added.
| name | The name of the path parameter. |
| value | The new value to set for the path parameter. |
| void RestLink::RequestInterface::setPathParameter | ( | const PathParameter & | parameter | ) |
Sets a path parameter using a PathParameter object.
This function sets or updates a path parameter using a PathParameter object.
| parameter | The PathParameter object containing the name and value. |
| void RestLink::RequestInterface::unsetPathParameter | ( | const QString & | name | ) |
Unsets (removes) a path parameter from the request.
This function removes the path parameter with the given name from the request.
| name | The name of the path parameter to remove. |
| QList< PathParameter > RestLink::RequestInterface::pathParameters | ( | ) | const |
Retrieves all path parameters.
This function returns a list of all path parameters in the request.
| void RestLink::RequestInterface::setPathParameters | ( | const QList< PathParameter > & | parameters | ) |
Sets all path parameters.
This function sets the list of path parameters to the provided list of parameters.
| parameters | A list of path parameters to set. |
| bool RestLink::RequestInterface::hasQueryParameter | ( | const QString & | name | ) | const |
Checks if a query parameter exists in the request.
This function checks whether a query parameter with the given name exists.
| name | The name of the query parameter. |
| QueryParameter RestLink::RequestInterface::queryParameter | ( | const QString & | name | ) | const |
Retrieves a specific query parameter.
This function retrieves the query parameter for the given name. If the parameter is not found, it returns a default-constructed QueryParameter.
| name | The name of the query parameter. |
| QList< QVariant > RestLink::RequestInterface::queryParameterValues | ( | const QString & | name | ) | const |
Retrieves the values of a query parameter.
This function returns a list of values associated with the given query parameter name. If the parameter is not found, an empty list is returned.
| name | The name of the query parameter. |
| QStringList RestLink::RequestInterface::queryParameterNames | ( | ) | const |
Retrieves the names of all query parameters.
This function returns a list of names of all the query parameters in the request.
| void RestLink::RequestInterface::addQueryParameter | ( | const QString & | name, |
| const QVariant & | value | ||
| ) |
Add the value of a query parameter.
This function sets or updates the value of a query parameter in the request. If the parameter does not exist, it is added.
| name | The name of the query parameter. |
| value | The new value to set for the query parameter. |
| void RestLink::RequestInterface::addQueryParameter | ( | const QueryParameter & | param | ) |
Add query parameter using a QueryParameter object.
This function sets or updates a query parameter using a QueryParameter object.
| param | The QueryParameter object containing the name and value. |
| void RestLink::RequestInterface::removeQueryParameter | ( | const QString & | name | ) |
Removes a query parameter from the request.
This function removes the query parameter with the given name from the request.
| name | The name of the query parameter to remove. |
| void RestLink::RequestInterface::removeQueryParameter | ( | const QString & | name, |
| const QVariant & | value | ||
| ) |
Removes a query parameter from the request.
This function removes the value on the query parameter if it exists.
| name | The name of the query parameter to remove. |
| QList< QueryParameter > RestLink::RequestInterface::queryParameters | ( | ) | const |
Retrieves all query parameters.
This function returns a list of all query parameters in the request.
| void RestLink::RequestInterface::setQueryParameters | ( | const QList< QueryParameter > & | parameters | ) |
Sets all query parameters.
This function sets the list of query parameters to the provided list of parameters.
| parameters | A list of query parameters to set. |
| bool RestLink::RequestInterface::hasHeader | ( | const QString & | name | ) | const |
Checks if a header exists in the request.
This function checks whether a header with the given name exists.
| name | The name of the header. |
| Header RestLink::RequestInterface::header | ( | const QString & | name | ) | const |
Retrieves a specific header.
This function retrieves the header for the given name. If the header is not found, it returns a default-constructed Header.
| name | The name of the header. |
| QList< QVariant > RestLink::RequestInterface::headerValues | ( | const QString & | name | ) | const |
Retrieves the values of a header.
This function returns a list of values associated with the given header name. If the header is not found, an empty list is returned.
| name | The name of the header. |
| QStringList RestLink::RequestInterface::headerNames | ( | ) | const |
Retrieves the names of all headers.
This function returns a list of names of all the headers in the request.
| void RestLink::RequestInterface::setHeader | ( | const QString & | name, |
| const QVariant & | value | ||
| ) |
Sets the value of a header.
This function sets or updates the value of a header in the request. If the header does not exist, it is added.
| name | The name of the header. |
| value | The new value to set for the header. |
| void RestLink::RequestInterface::setHeader | ( | const Header & | header | ) |
| void RestLink::RequestInterface::unsetHeader | ( | const QString & | name | ) |
Unsets (removes) a header from the request.
This function removes the header with the given name from the request.
| name | The name of the header to remove. |
| QList< Header > RestLink::RequestInterface::headers | ( | ) | const |
Retrieves all headers.
This function returns a list of all headers in the request.
| void RestLink::RequestInterface::setHeaders | ( | const QList< Header > & | headers | ) |
Sets all headers.
This function sets the list of headers to the provided list of headers.
| headers | A list of headers to set. |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |