Class HTTPClientSettings
Defines an HTTP/HTTPS proxy request or a connection timeout for an HTTPClient
.
Inherits from
-
Object
(base class)
Fields
Name | Type | Description |
---|---|---|
defaultKeepAliveTimeout
|
core |
|
proxyURL
|
URL |
Example
void test() {
HTTPClientSettings settings = new HTTPClientSettings;
settings .proxyURL = URL .parse("http://proxyuser:proxypass@192.168.2.50:3128");
settings .defaultKeepAliveTimeout = 0 .seconds; // closes connection immediately after receiving the data.
requestHTTP("http://www.example.org",
(scope req){
req .method = HTTPMethod .GET;
},
(scope res){
logInfo("Headers:");
foreach(key, ref value; res .headers) {
logInfo("%s: %s", key, value);
}
logInfo("Response: %s", res .bodyReader .readAllUTF8());
}, settings);
}
Authors
Sönke Ludwig, Jan Krüger
Copyright
© 2012-2014 RejectedSoftware e.K.
License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.