Class HTTPClient
Implementation of a HTTP 1.0/1.1 client with keep-alive support.
class HTTPClient
;
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.
Properties
Name | Type | Description |
---|---|---|
settings [get]
|
const(HTTPClientSettings) | Get the current settings for the HTTP client. |
Methods
Name | Description |
---|---|
connect
(server, port, use_tls, settings)
|
Connects to a specific server. |
disconnect
()
|
Forcefully closes the TCP connection. |
request
(requester, responder)
|
Performs a HTTP request. |
setTLSSetupCallback
(func)
|
Sets a callback that will be called for every TLS context that is created. |
setUserAgentString
(str)
|
Sets the default user agent string for new HTTP requests. |