Struct Request
Structure Request provides configuration, connection pooling, cookie persistance. You can consider it as 'Session'.
struct Request
;
Fields
Name | Type | Description |
---|---|---|
_authenticator
|
Auth | Auth provider |
_bind
|
string | bind outgoing connections to this addr (name or ip) |
_bufferSize
|
ulong | io buffer size |
_cm
|
std | connection cache |
_contentType
|
string | content type for POST/PUT requests |
_cookie
|
std | cookie storage |
_headers
|
string[string] | user-provided headers(use addHeader to add) |
_interceptors
|
Interceptor[] | user-provided interceptors |
_keepAlive
|
bool | use keepalive requests |
_maxContentLength
|
ulong | maximum content length |
_maxHeadersLength
|
ulong | maximum headers length |
_maxRedirects
|
uint | limit redirect number |
_method
|
string | method (GET, POST, ...) |
_multipartForm
|
MultipartForm | multipart form (for multipart POST requests) |
_params
|
std | request parameters |
_permanent_redirects
|
string[requests | permanent redirect cache |
_postData
|
requests | unified interface for post data |
_proxy
|
string | http/https proxy |
_socketFactory
|
requests | user-provided socket factory |
_sslOptions
|
requests | |
_sslSetVerifyPeer
|
bool | verify peer when using ssl |
_timeout
|
core | timeout for connect/send/receive |
_uri
|
requests | uri for the request |
_userHeaders
|
_UH | |
_useStreaming
|
bool | use streaming when receive response |
_verbosity
|
uint | logging verbosity |
Properties
Name | Type | Description |
---|---|---|
authenticator [get]
|
inout(Auth) | |
authenticator [set]
|
Auth | |
bind [get]
|
inout(string) | |
bind [set]
|
string | |
bufferSize [get]
|
inout(ulong) | |
bufferSize [set]
|
ulong | |
cm [get]
|
std | |
contentType [get]
|
inout(string) | |
cookie [get]
|
inout(std | |
cookie [set]
|
std | |
hasMultipartForm [get]
|
bool | helper |
headers [get]
|
inout(string[string]) | |
headers [set]
|
string[string] | |
keepAlive [get]
|
inout(bool) | |
keepAlive [set]
|
bool | |
maxContentLength [get]
|
inout(ulong) | |
maxContentLength [set]
|
ulong | |
maxHeadersLength [get]
|
inout(ulong) | |
maxHeadersLength [set]
|
ulong | |
maxRedirects [get]
|
inout(uint) | |
maxRedirects [set]
|
uint | |
method [get]
|
inout(string) | |
method [set]
|
string | |
multipartForm [get]
|
inout(MultipartForm) | |
params [get]
|
inout(std | |
path [get, set]
|
string | Set/Get path for next request. |
permanent_redirects [get]
|
inout(string[requests | |
postData [get]
|
inout(requests | |
proxy [get]
|
inout(string) | |
proxy [set]
|
string | |
socketFactory [get]
|
requests | |
socketFactory [set]
|
requests | |
sslOptions [get]
|
inout(requests | |
sslSetCaCert [set]
|
string | Set path to certificate authority file. |
sslSetCertFile [set]
|
string | Set path and format for ssl certificate file. |
sslSetKeyFile [set]
|
string | Set path and format for ssl key file. |
sslSetVerifyPeer [set]
|
bool | Enable/disable ssl peer verification.. |
timeout [get]
|
inout(core | |
timeout [set]
|
core | |
uri [get]
|
inout(requests | |
uri [set]
|
string | Set and Get uri for next request. |
useStreaming [get]
|
inout(bool) | |
useStreaming [set]
|
bool | |
verbosity [get]
|
inout(uint) | |
verbosity [set]
|
uint | |
userHeaders [get]
|
_UH |
Methods
Name | Description |
---|---|
addHeaders
|
Add headers to request |
addInterceptor
|
Add interceptor to request. |
clearHeaders
|
Remove any previously added headers. |
deleteRequest
|
|
deleteRequest
|
|
exec
|
Execute GET for http and retrieve file for FTP. You have to provide at least uri. All other arguments should conform to HTTPRequest.get or FTPRequest.get depending on the URI scheme. When arguments do not conform scheme (for example you try to call get("ftp://somehost.net/pub/README", {"a":"b"}) which doesn't make sense) you will receive Exception("Operation not supported for ftp") |
exec
|
|
execute
|
|
execute
|
|
execute
|
|
format
|
|
get
|
|
get
|
|
patch
|
|
patch
|
|
patch
|
|
post
|
|
post
|
|
post
|
|
post
|
|
put
|
|
put
|
|
put
|
|
toString
|
Inner classes
Name | Description |
---|---|
LastInterceptor
|
Aliases
Name | Description |
---|---|
__xdtor
|
|
__xpostblit
|