View Source locus_http_download (locus v2.3.6)
Link to this section Summary
Link to this section Types
Specs
body() :: binary().
Specs
event() :: event_request_sent() | event_download_dismissed() | event_download_redirected() | event_download_failed_to_start() | event_download_started() | event_download_finished().
Specs
event_download_dismissed() :: {download_dismissed, full_http_response()}.
Specs
event_download_failed_to_start() :: {download_failed_to_start, reason_for_download_failing_to_start()}.
Specs
event_download_finished() :: {download_finished, BodySize :: non_neg_integer(), {ok, TrailingHeaders :: headers()}} | {download_finished, BodySize :: non_neg_integer(), {error, term()}} | {download_finished, BodySize :: non_neg_integer(), {error, timeout}}.
Specs
event_download_redirected() :: {download_redirected, redirection()}.
Specs
event_download_started() :: {download_started, headers()}.
Specs
Specs
full_http_response() :: {http, response_status(), headers(), body()}.
Specs
headers() :: [{string(), string()}].
Specs
Specs
opt() :: {connect_timeout, timeout()} | {download_start_timeout, timeout()} | {idle_download_timeout, timeout()} | insecure | {insecure, boolean()} | {censor_query, CensoredKeys :: [atom()]}.
Specs
reason_for_download_failing_to_start() :: full_http_response() | too_many_redirections | {invalid_redirection, term()} | {error, term()} | timeout.
Specs
redirection() :: #{url := url(), permanence := permanent | temporary}.
Specs
response_status() :: {100..999, binary()}.
Specs
state() :: #state{}.
Specs
success() :: #{headers := headers(), body := binary()}.
Specs
url() :: string().