The mock response to be sent to client.
More...
#include <MockResponse.h>
The mock response to be sent to client.
MockResponse & MockResponse::addHeader |
( |
const QString & |
header | ) |
|
Add a response header.
- Parameters
-
header | The header to be added. |
- Returns
- Reference of this object.
MockResponse & MockResponse::addHeader |
( |
const QString & |
key, |
|
|
const QString & |
value |
|
) |
| |
Add a response header by key/value pairs.
- Parameters
-
key | Header name. |
value | Header value. |
- Returns
- Reference of this object.
QByteArray MockResponse::body |
( |
| ) |
const |
Body of response.
- Returns
- Body of response.
Clear all response headers.
- Returns
- Reference of this object.
QList< QString > MockResponse::headers |
( |
| ) |
const |
A list of response header.
- Returns
- A list of response of response headers.
MockResponse & MockResponse::removeHeader |
( |
const QString & |
key | ) |
|
Remove header with given name.
- Parameters
-
- Returns
- Reference of this object.
MockResponse & MockResponse::setBody |
( |
const QByteArray & |
body | ) |
|
Set body of response.
- Parameters
-
- Returns
- Reference of this object.
MockResponse & MockResponse::setChunkedBody |
( |
const QByteArray & |
body, |
|
|
int |
maxChunkSize |
|
) |
| |
Set chunked body of response.
- Parameters
-
body | Whole body of response. |
maxChunkSize | Max size limit of each chunk. |
- Returns
- Reference of this object.
MockResponse & MockResponse::setHeader |
( |
const QString & |
key, |
|
|
const QString & |
value |
|
) |
| |
Set header value with given name.
- Parameters
-
key | Header name. |
value | Header value. |
- Returns
- Reference of this object.
Set status code of response.
- Parameters
-
- Returns
- Reference of this object.
MockResponse & MockResponse::setStatus |
( |
const QString & |
status | ) |
|
Set status line of response.
- Parameters
-
- Returns
- Reference of this object.
QString MockResponse::status |
( |
| ) |
const |
Status line of response.
- Returns
- Status line of response such as "HTTP/1.1 200 OK".
The documentation for this class was generated from the following files: