HttpClient

Implements a HTTP client. Generally used to send one HTTP request.

Constructors

this
this(Duration timeout, Connector connector)

Constructor.

Members

Functions

adaptConnection
IConnection adaptConnection(IConnection conn)
Undocumented in source. Be warned that the author may not have intended to support it.
connected
bool connected()

Returns true if a connection is active (whether due to an in-flight request or due to keep-alive).

disconnect
void disconnect(string reason)

Close the connection to the HTTP server.

onConnect
void onConnect()
Undocumented in source. Be warned that the author may not have intended to support it.
onContinuation
void onContinuation(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
onData
void onData(Data[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
onDisconnect
void onDisconnect(string reason, DisconnectType type)
Undocumented in source. Be warned that the author may not have intended to support it.
onDone
void onDone()
Undocumented in source. Be warned that the author may not have intended to support it.
onHeadersReceived
void onHeadersReceived()
Undocumented in source. Be warned that the author may not have intended to support it.
onNewResponse
void onNewResponse(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
processResponse
void processResponse(string reason)
Undocumented in source. Be warned that the author may not have intended to support it.
request
void request(HttpRequest request)

Send a HTTP request.

sendRawRequest
void sendRawRequest(HttpRequest request)
Undocumented in source. Be warned that the author may not have intended to support it.
sendRequest
void sendRequest(HttpRequest request)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

agent
string agent;

User-Agent header to advertise.

conn
IConnection conn;
Undocumented in source.
connector
Connector connector;
Undocumented in source.
currentRequest
HttpRequest currentRequest;
Undocumented in source.
currentResponse
HttpResponse currentResponse;
Undocumented in source.
expect
size_t expect;
Undocumented in source.
handleResponse
void delegate(HttpResponse response, string disconnectReason) handleResponse;

User-supplied callback for handling the response.

inBuffer
DataVec inBuffer;
Undocumented in source.
keepAlive
bool keepAlive;

Keep connection alive after one request.

timer
TimeoutAdapter timer;
Undocumented in source.

Meta