HTTPClient

Implementation of a HTTP 1.0/1.1 client with keep-alive support.

Note that it is usually recommended to use requestHTTP for making requests as that will use a pool of HTTPClient instances to keep the number of connection establishments low while not blocking requests from different tasks.

Members

Functions

connect
void connect(string server, ushort port, bool use_tls, const(HTTPClientSettings) settings)

Sets up this HTTPClient to connect to a specific server.

disconnect
void disconnect()

Forcefully closes the TCP connection.

request
void request(void delegate(scope HTTPClientRequest req) requester, void delegate(scope HTTPClientResponse) responder)
HTTPClientResponse request(void delegate(HTTPClientRequest) requester)

Performs a HTTP request.

Manifest constants

maxHeaderLineLength
enum maxHeaderLineLength;
Undocumented in source.

Properties

settings
const(HTTPClientSettings) settings [@property getter]

Get the current settings for the HTTP client. *

Static functions

setTLSSetupCallback
void setTLSSetupCallback(void function(TLSContext) @(safe) func)

Sets a callback that will be called for every TLS context that is created.

setUserAgentString
void setUserAgentString(string str)

Sets the default user agent string for new HTTP requests.

Meta