Outgoing message from the perspective of the participants of an HTTP transaction.
More...
#include <HttpConnection.h>
|
| Result | startResponse (int httpCode) |
| | Starts the response with a http standard code (200 OK, 404 NOT FOUND etc.)
|
| |
| Result | addHeader (StringSpan headerName, StringSpan headerValue) |
| | Writes an http header to this response.
|
| |
| Result | sendHeaders () |
| | Start sending response headers, before sending any data.
|
| |
| void | reset () |
| | Resets this object for it to be re-usable.
|
| |
| Result | end () |
| | Finalizes the writable stream after sending all in progress writes.
|
| |
| AsyncWritableStream & | getWritableStream () |
| | Obtain writable stream for sending content back to connected client.
|
| |
| void | setKeepAlive (bool keepAlive) |
| | Sets whether to keep the connection alive after this response.
|
| |
| bool | getKeepAlive () const |
| | Gets whether the connection should be kept alive after this response.
|
| |
|
|
struct | HttpConnectionsPool |
| |
|
struct | HttpAsyncServer |
| |
Outgoing message from the perspective of the participants of an HTTP transaction.
◆ addHeader()
Writes an http header to this response.
- Returns
- Valid Result if header was added successfully.
- Warning
- Adding a "Connection" header can fail if keep-alive has been force disabled
◆ end()
| Result SC::HttpResponse::end |
( |
| ) |
|
Finalizes the writable stream after sending all in progress writes.
◆ getKeepAlive()
| bool SC::HttpResponse::getKeepAlive |
( |
| ) |
const |
|
inlinenodiscard |
Gets whether the connection should be kept alive after this response.
- Returns
- true if connection should be kept alive
◆ getWritableStream()
Obtain writable stream for sending content back to connected client.
◆ reset()
| void SC::HttpResponse::reset |
( |
| ) |
|
Resets this object for it to be re-usable.
◆ sendHeaders()
| Result SC::HttpResponse::sendHeaders |
( |
| ) |
|
Start sending response headers, before sending any data.
◆ setKeepAlive()
| void SC::HttpResponse::setKeepAlive |
( |
bool | keepAlive | ) |
|
Sets whether to keep the connection alive after this response.
- Parameters
-
| keepAlive | true to keep connection open for more requests, false to close after response |
- Warning
- HttpConnection can force disable keep-alive when running out of connections to prevent server deadlock
◆ startResponse()
| Result SC::HttpResponse::startResponse |
( |
int | httpCode | ) |
|
Starts the response with a http standard code (200 OK, 404 NOT FOUND etc.)
The documentation for this struct was generated from the following file: