Type of the options object passed to Http.request
.
Fields
optionaltimeout:Null<Int>
A number specifying the socket timeout in milliseconds. This will set the timeout before the socket is connected.
optionalsocketPath:Null<String>
Unix Domain Socket (cannot be used if one of host or port is specified, those specify a TCP Socket).
optionalsetHost:Null<Bool>
Specifies whether or not to automatically add the Host header.
Defaults to true
.
optionalpath:Null<String>
Request path. Should include query string if any. E.G. '/index.html?page=12'
.
An exception is thrown when the request path contains illegal characters.
Currently, only spaces are rejected but that may change in the future.
Default: '/'
.
optionalhostname:Null<String>
Alias for host
.
To support url.parse()
, hostname will be used if both host
and hostname
are specified.
optionalhost:Null<String>
A domain name or IP address of the server to issue the request to.
Default: 'localhost'
.
optionalheaders:Null<DynamicAccess<EitherType<String, Array<String>>>>
An object containing request headers.
optionalfamily:Null<DnsAddressFamily>
IP address family to use when resolving host
or hostname
.
Valid values are 4
or 6
. When unspecified, both IP v4 and v6 will be used.
optionaldefaultPort:Null<Int>
Default port for the protocol.
Default: agent.defaultPort
if an Agent is used, else undefined
.
optionalcreateConnection:Null<(options:SocketConnectOptionsTcp, callabck:(err:Error, stream:IDuplex) ‑> Void) ‑> IDuplex>
A function that produces a socket/stream to use for the request when the agent
option is not used.
This can be used to avoid creating a custom Agent
class just to override the default createConnection
function.
See agent.createConnection() for more details.
Any Duplex
stream is a valid return value.