Types
Method =
head | get | put | patch | post | trace | options | delete
Request =
{uri_string:uri_string(), [HttpHeader]} |
{uri_string:uri_string(),
[HttpHeader],
ContentType :: uri_string:uri_string(),
HttpBody}
HttpBody =
iolist() |
binary() |
{fun((Accumulator :: term()) ->
eof | {ok, iolist(), Accumulator :: term()}),
Accumulator :: term()} |
{chunkify,
fun((Accumulator :: term()) ->
eof | {ok, iolist(), Accumulator :: term()}),
Accumulator :: term()}
HttpHeader = {Field :: [byte()], Value :: binary() | iolist()}
HttpOptions = [HttpOption]
HttpOption =
{timeout, timeout()} |
{connect_timeout, timeout()} |
{ssl, [ssl:tls_option()]} |
{autoredirect, boolean()} |
{proxy_auth, {string(), string()}} |
{version, HttpVersion} |
{relaxed, boolean()}
Options = [OptionRequest]
OptionRequest =
{sync, boolean()} |
{stream, StreamTo} |
{body_format, BodyFormat} |
{full_result, boolean()} |
{headers_as_is, boolean()} |
{socket_opts, [SocketOpt]} |
{receiver, Receiver} |
{ipv6_host_with_brackets, boolean()}
StreamTo = none | self | {self, once} | file:name_all()
BodyFormat = string() | binary() | atom()
SocketOpt = term()
Receiver =
pid() |
fun((term()) -> term()) |
{ReceiverModule :: atom(),
ReceiverFunction :: atom(),
ReceiverArgs :: list()}
Profile = atom() | pid()
When Profile is stand_alone only the pid can be used.
HttpVersion = uri_string:uri_string()
Result =
{StatusLine, [HttpHeader], HttpBodyResult} |
{StatusCode, HttpBodyResult} |
RequestId | saved_to_file
StatusLine = {HttpVersion, StatusCode, string()}
StatusCode = integer() >= 0
HttpBodyResult = uri_string:uri_string() | binary()
RequestId = any()