hackney_util (hackney v2.0.0-beta.1)

View Source

Summary

Functions

Get the default protocols for HTTP connections. Returns the value of the default_protocols` application env, or `[http2, http1] if not set.

filter a proplists and only keep allowed keys

Start the given applications if they were not already started.

set the default options in a proplists if not defined

Functions

default_protocols()

-spec default_protocols() -> [http3 | http2 | http1].

Get the default protocols for HTTP connections. Returns the value of the default_protocols` application env, or `[http2, http1] if not set.

The order determines preference: HTTP/2 is preferred, then HTTP/1.1.

To enable HTTP/3 (experimental):

  application:set_env(hackney, default_protocols, [http3, http2, http1]).

filter_options(Tail, AllowedKeys, Acc)

-spec filter_options([{atom(), any()} | {raw, any(), any(), any()}], [atom()], Acc) -> Acc
                        when Acc :: [any()].

filter a proplists and only keep allowed keys

is_ipv6(Host)

maybe_apply_defaults(Rest, Options)

merge_opts(Rest, Options)

mod_metrics()

privdir()

require(Rest)

-spec require([module()]) -> ok.

Start the given applications if they were not already started.

set_option_default(Opts, Key, Value)

-spec set_option_default(Opts, atom(), any()) -> Opts when Opts :: [{atom(), any()}].

set the default options in a proplists if not defined

to_atom(V)

to_int(S)