123456789101112131415161718192021222324252627282930313233module juptune.http.common;
struct HttpResponse
{
/++ ALIASES ++/
///
alias __xdtor = __MARMOS_BUG__;
/++ FUNCTIONS ++/
///
ArrayBase!(Malloc, 8LU, (length, capacity) => max(capacity, length) * 2, (length, capacity) => length < capacity / 2, (length, capacity) => capacity / 2, ubyte) body();
///
ArrayBase!(Malloc, 8LU, (length, capacity) => max(capacity, length) * 2, (length, capacity) => length < capacity / 2, (length, capacity) => capacity / 2, HttpHeader) headers();
///
HttpResponse opAssign(HttpResponse p);
///
void putBody(const const ubyte[] body);
/// The status of the response.
String reason();
///
void setHeader(KeyT, ValueT)(KeyT key, ValueT value);
/// The reason of the response.
uint status();
///
HttpHeader tryGetHeader(KeyT)(KeyT key, bool wasFound);
/// Sets the reason of the response.
void withReason(ReasonT)(ReasonT reason);
/// Sets the status of the response.
void withStatus(uint status);
}
Represents a HTTP response with a status code + reason; headers; a body, and trailers.
| Name | Description |
|---|---|
| __xdtor |
| Name | Description |
|---|---|
| body | |
| headers | |
| opAssign | |
| putBody | |
| reason |
The status of the response. |
| setHeader | |
| status |
The reason of the response. |
| tryGetHeader | |
| withReason |
Sets the reason of the response. |
| withStatus |
Sets the status of the response. |