View Source aws_credentials_httpc (aws_credentials v0.2.3)
This implements an http client using the Erlang built in http client. If desired, this could be abstracted to support arbitrary http clients that return {ok, Status :: non_neg_integer(), Body :: binary(), Headers :: map()}
or {error, Reasons :: [term()]}
.
Summary
Functions
Attempt to request a URL with the 3 retries. 3 is the default.
Attempt to request a URL with a specified positive number of retries. (Minimum of 1.)
Types
-type body() :: binary().
-type headers() :: [header()].
-type http_version() :: string().
-type httpc_result() :: {status_line(), [header()], body()}.
-type method() :: atom().
-type reason_phrase() :: string().
-type response() :: {error, response_error()} | {ok, status_code(), body(), headers()}.
-type response_error() :: any().
-type status_code() :: non_neg_integer().
-type status_line() :: {http_version(), status_code(), reason_phrase()}.
-type url() :: string().
Functions
-spec request(method(), url(), [header()], pos_integer()) -> response().
Attempt to request a URL with a specified positive number of retries. (Minimum of 1.)
Note this function may return{ok, Results}
even if it was unable to successfully get the desired data. That is, it will return an ok tuple with a status code of 500 or 404 or some other HTTP error code and no data.
-spec start() -> ok.