buoy (buoy v0.2.6)
View SourceSummary
Types
-type body() :: undefined | iodata().
-type buoy_opts() :: #{headers => headers(), body => body(), pid => pid(), timeout => non_neg_integer()}.
-type buoy_resp() :: #buoy_resp{state :: body | done, body :: undefined | binary(), content_length :: undefined | non_neg_integer() | chunked, headers :: undefined | [binary()], reason :: undefined | binary(), status_code :: undefined | 100..505}.
-type buoy_url() :: #buoy_url{host :: host(), hostname :: hostname(), path :: path(), port :: inet:port_number(), protocol :: protocol_http()}.
-type error() :: {error, term()}.
-type host() :: binary().
-type hostname() :: binary().
-type method() :: get | head | post | put | {custom, binary()}.
-type path() :: binary().
-type protocol_http() :: http | https.
Functions
-spec async_custom(binary(), buoy_url(), buoy_opts()) -> {ok, shackle:request_id()} | error().
-spec async_get(buoy_url(), buoy_opts()) -> {ok, shackle:request_id()} | error().
-spec async_head(buoy_url(), buoy_opts()) -> {ok, shackle:request_id()} | error().
-spec async_post(buoy_url(), buoy_opts()) -> {ok, shackle:request_id()} | error().
-spec async_put(buoy_url(), buoy_opts()) -> {ok, shackle:request_id()} | error().
-spec async_request(method(), buoy_url(), buoy_opts()) -> {ok, shackle:request_id()} | error().
-spec receive_response(shackle:request_id()) -> {ok, term()} | error().