The Cute::Server::HttpResponse class represents the HTTP response that HTTP handlers send to clients. More...
Header: | #include <HttpResponse> |
HttpResponse(const Cute::Server::HttpResponse &other) | |
HttpResponse(int httpStatusCode, const QByteArray &description = QByteArray(), const QByteArray &body = QByteArray(), int majorHttpVersion = 1, int minorHttpVersion = 1) | |
HttpResponse(Cute::Server::HttpStatusCode httpStatusCode, const QByteArray &body = QByteArray(), int majorHttpVersion = 1, int minorHttpVersion = 1) | |
HttpResponse() | |
Cute::Server::HttpResponse & | operator=(const Cute::Server::HttpResponse &other) |
~HttpResponse() | |
void | addHeader(const QByteArray &name, const QByteArray &value) |
const QByteArray & | body() const |
void | clear() |
const QByteArray & | description() const |
QByteArray | header(const QByteArray &name) const |
int | headerCount(const QByteArray &name) const |
QVector<QByteArray> | headers(const QByteArray &name) const |
int | headersCount() const |
int | majorHttpVersion() const |
int | minorHttpVersion() const |
void | setBody(const QByteArray &body) |
void | setHttpVersion(int majorVersion, int minorVersion) |
void | setStatusCode(Cute::Server::HttpStatusCode statusCode) |
int | statusCode() const |
void | write(QByteArray &buffer) const |
bool | operator!=(const Cute::Server::HttpResponse &other) const |
bool | operator==(const Cute::Server::HttpResponse &other) const |
The Cute::Server::HttpResponse class represents the HTTP response that HTTP handlers send to clients.
Constructs a copy of other.
Constructs a HTTP response with httpStatusCode status code, having description with body as message body, and with HTTP version majorHttpVersion.minorHttpVersion. Note that the Cute Server HTTP request parser supports HTTP version 1.1.
Constructs a HTTP response with httpStatusCode status code, having body as message body, and with HTTP version majorHttpVersion.minorHttpVersion. Note that the Cute Server HTTP request parser supports HTTP version 1.1.
Constructs an empty HTTP response. An empty HTTP response has 0 as status code, empty description and body, no headers and major and minor HTTP versions set to 0.
Assigns other to this HTTP response and returns a reference to this HTTP response.
Destroys the HTTP response.
Adds the HTTP response header name: value to this HTTP response.
Returns the body of this HTTP response message.
See also setBody().
Clears this HTTP response. This method has the same effect as assigning this HTTP response to a default-constructed HTTP response.
Returns the description for this HTTP response status code.
Returns the value of the header with name. If this HTTP response does not contain a header with name, an empty QByteArray is returned. If this response has many headers with same name, the value returned will be from one of the headers.
See also headerCount and headers.
Returns the number of headers in this HTTP response with name as header name.
Returns all values of headers named name in this HTTP response. If this HTTP response does not contain a header named name, the returned vector is empty. Otherwise it contains the values from all headers named name.
See also header and headerCount.
Returns the number of headers in this HTTP response.
Returns the major HTTP version of this HTTP response.
Returns the minor HTTP version of this HTTP response.
Sets this HTTP response message body to body. Note that this method does not set the content-length header, that must be sent by addHeader.
See also body().
Sets HTTP version of this response to majorVersion.minorVersion.
Sets the HTTP response status code of this response to statusCode.
See also statusCode().
Returns the HTTP status code of this response.
See also setStatusCode().
Writes the content of this HTTP response to buffer.
Returns true if this HTTP response is not equal to other; otherwise returns false.
Returns true if this HTTP response is equal to other; otherwise returns false.