Struct Request

Structure Request provides configuration, connection pooling, cookie persistance. You can consider it as 'Session'.

struct Request ;

Fields

NameTypeDescription
_authenticator AuthAuth provider
_bind stringbind outgoing connections to this addr (name or ip)
_bufferSize ulongio buffer size
_cm std.typecons.RefCounted!(requests.connmanager.ConnManager,1)connection cache
_contentType stringcontent type for POST/PUT requests
_cookie std.typecons.RefCounted!(requests.utils.Cookies,1)cookie storage
_headers string[string]user-provided headers(use addHeader to add)
_interceptors Interceptor[]user-provided interceptors
_keepAlive booluse keepalive requests
_maxContentLength ulongmaximum content length
_maxHeadersLength ulongmaximum headers length
_maxRedirects uintlimit redirect number
_method stringmethod (GET, POST, ...)
_multipartForm MultipartFormmultipart form (for multipart POST requests)
_params std.typecons.Tuple!(string,"key",string,"value")[]request parameters
_permanent_redirects string[requests.uri.URI]permanent redirect cache
_postData requests.rangeadapter.InputRangeAdapterunified interface for post data
_proxy stringhttp/https proxy
_socketFactory requests.streams.NetworkStream delegate(string, string, ushort)user-provided socket factory
_sslOptions requests.streams.SSLOptions
_sslSetVerifyPeer boolverify peer when using ssl
_timeout core.time.Durationtimeout for connect/send/receive
_uri requests.uri.URIuri for the request
_userHeaders _UH
_useStreaming booluse streaming when receive response
_verbosity uintlogging verbosity

Properties

NameTypeDescription
authenticator[get] inout(Auth)
authenticator[set] Auth
bind[get] inout(string)
bind[set] string
bufferSize[get] inout(ulong)
bufferSize[set] ulong
cm[get] std.typecons.RefCounted!(requests.connmanager.ConnManager,1)
contentType[get] inout(string)
cookie[get] inout(std.typecons.RefCounted!(requests.utils.Cookies,1))
cookie[set] std.typecons.RefCounted!(requests.utils.Cookies,1)
hasMultipartForm[get] boolhelper
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.typecons.Tuple!(string,"key",string,"value")[])
path[get, set] stringSet/Get path for next request.
permanent_redirects[get] inout(string[requests.uri.URI])
postData[get] inout(requests.rangeadapter.InputRangeAdapter)
proxy[get] inout(string)
proxy[set] string
socketFactory[get] requests.streams.NetworkStream delegate(string, string, ushort) inout
socketFactory[set] requests.streams.NetworkStream delegate(string, string, ushort)
sslOptions[get] inout(requests.streams.SSLOptions)
sslSetCaCert[set] stringSet path to certificate authority file.
sslSetCertFile[set] stringSet path and format for ssl certificate file.
sslSetKeyFile[set] stringSet path and format for ssl key file.
sslSetVerifyPeer[set] boolEnable/disable ssl peer verification..
timeout[get] inout(core.time.Duration)
timeout[set] core.time.Duration
uri[get] inout(requests.uri.URI)
uri[set] stringSet and Get uri for next request.
useStreaming[get] inout(bool)
useStreaming[set] bool
verbosity[get] inout(uint)
verbosity[set] uint
userHeaders[get] _UH

Methods

NameDescription
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

NameDescription
LastInterceptor

Aliases

NameDescription
__xdtor
__xpostblit