HTTPClientResponse

Represents a HTTP client response (as received from the server).

Constructors

this
this(HTTPClient client, bool has_body, bool close_conn, IAllocator alloc, SysTime connected_time)

private

Destructor

~this
~this()
Undocumented in source.

Members

Functions

disconnect
void disconnect()

Forcefully terminates the connection regardless of the current state.

dropBody
void dropBody()

Reads and discards the response body.

readJson
Json readJson()

Reads the whole response body and tries to parse it as JSON.

readRawBody
void readRawBody(void delegate(scope InterfaceProxy!InputStream stream) @(safe) del)
void readRawBody(void delegate(scope InputStream stream) @(safe) del)

Provides unsafe means to read raw data from the connection.

switchProtocol
ConnectionStream switchProtocol(string new_protocol)
void switchProtocol(string new_protocol, void delegate(ConnectionStream str) @(safe) del)

Switches the connection to a new protocol and returns the resulting ConnectionStream.

Properties

bodyReader
InterfaceProxy!InputStream bodyReader [@property getter]

An input stream suitable for reading the response body.

cookies
DictionaryList!Cookie cookies [@property getter]

All cookies that shall be set on the client for this request

maxRequests
int maxRequests [@property getter]

Contains the keep-alive 'max' parameter, indicates how many requests a client can make before the server closes the connection.

Meta