HTTPRequest

Request. Configurable parameters: method - string, method to use (GET, POST, ...) headers - stringstring, add any additional headers you'd like to send. authenticator - class Auth, class to send auth headers. keepAlive - bool, set true for keepAlive requests. default true. maxRedirects - uint, maximum number of redirects. default 10. maxHeadersLength - size_t, maximum length of server response headers. default = 32KB. maxContentLength - size_t, maximun content length. delault - 0 = unlimited. bufferSize - size_t, send and receive buffer size. default = 16KB. verbosity - uint, level of verbosity(0 - nothing, 1 - headers, 2 - headers and body progress). default = 0. proxy - string, set proxy url if needed. default - null. cookie - Tuple Cookie, Read/Write cookie You can get cookie setted by server, or set cookies before doing request. timeout - Duration, Set timeout value for connect/receive/send.

Constructors

this
this(string uri)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

addHeaders
void addHeaders(string[string] headers)

Add headers to request

clearHeaders
void clearHeaders()
Undocumented in source. Be warned that the author may not have intended to support it.
close_connection_if_not_keepalive
void close_connection_if_not_keepalive(NetworkStream _stream)

If we do not want keepalive request, or server signalled to close connection, then close it

exec
deprecated HTTPResponse exec(string url, MultipartForm sources)

Send multipart for request. You would like to use this method for sending large portions of mixed data or uploading files to forms. Content of the posted form consist of sources. Each source have at least name and value (can be string-like object or opened file, see more docs for MultipartForm struct)

exec
deprecated HTTPResponse exec(string url, R content, string contentType)

POST/PUT/... data from some string(with Content-Length), or from range of strings/bytes (use Transfer-Encoding: chunked). When rank 1 (flat array) used as content it must have length. In that case "content" will be sent directly to network, and Content-Length headers will be added. If you are goung to send some range and do not know length at the moment when you start to send request, then you can send chunks of chars or ubyte. Try not to send too short chunks as this will put additional load on client and server. Chunks of length 2048 or 4096 are ok.

exec
deprecated HTTPResponse exec(string url, QueryParam[] params)

Send request with parameters. If used for POST or PUT requests then application/x-www-form-urlencoded used. Request parameters will be encoded into request string or placed in request body for POST/PUT requests.

exec
deprecated HTTPResponse exec(string url, PostFile[] files)

WRAPPERS

exec
deprecated HTTPResponse exec(string url, string[string] params)

exec request with parameters when you can use dictionary (when you have no duplicates in parameter names) Consider switch to exec(url, QueryParams) as it more generic and clear.

exec_from_multipart_form
HTTPResponse exec_from_multipart_form(MultipartForm form)
Undocumented in source. Be warned that the author may not have intended to support it.
exec_from_parameters
HTTPResponse exec_from_parameters()
Undocumented in source. Be warned that the author may not have intended to support it.
exec_from_range
HTTPResponse exec_from_range(InputRangeAdapter postData)
Undocumented in source.
execute
HTTPResponse execute(Request r)
Undocumented in source. Be warned that the author may not have intended to support it.
format
string format(string fmt)
Undocumented in source. Be warned that the author may not have intended to support it.
get
deprecated HTTPResponse get(A args)

GET request. Simple wrapper over exec!"GET"

post
deprecated HTTPResponse post(string uri, A args)

POST request. Simple wrapper over exec!"POST"

removeHeaders
void removeHeaders(string[] headers)

Remove headers from request

select_proxy
string select_proxy(string scheme)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

proxy
string proxy [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
sslSetCaCert
string sslSetCaCert [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
sslSetCertFile
void sslSetCertFile(string p, SSLOptions.filetype t)
Undocumented in source. Be warned that the author may not have intended to support it.
sslSetKeyFile
void sslSetKeyFile(string p, SSLOptions.filetype t)
Undocumented in source. Be warned that the author may not have intended to support it.
sslSetVerifyPeer
bool sslSetVerifyPeer [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
uri
URI uri [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_response
HTTPResponse _response;
Undocumented in source.

Meta