Module conf_http

Dead simple HTTP/1.1 client.

Authors: Evgeny Khramtsov (xramtsov@gmail.com).

Description

Dead simple HTTP/1.1 client. This is not NIH. The rationale is to avoid dependency bloat.

Data Types

error_reason()

error_reason() = http_return() | {http_error, http_error_reason()} | inet:posix()

http_error_reason()

http_error_reason() = invalid_content_length | invalid_chunk_size | invalid_chunk_trailer | {invalid_mime_type, binary()} | {invalid_location, binary()} | string() | binary()

http_return()

http_return() = {non_neg_integer(), iodata(), [resp_hdr()], binary()}

options()

options() = #{timeout => non_neg_integer(), hdrs => [req_hdr()]}

req_hdr()

req_hdr() = {atom(), term()} | {iodata(), iodata()}

resp_hdr()

resp_hdr() = {atom() | string() | binary(), string() | binary()}

Function Index

find_hdr/2
format_error/1
get/1
get/2

Function Details

find_hdr/2

find_hdr(Hdr::atom(), Hdrs::[resp_hdr()]) -> {ok, term()} | {error, notfound}

format_error/1

format_error(Reason::error_reason()) -> string()

get/1

get(URI::uri_string:uri_map()) -> {ok, [resp_hdr()], binary()} | {error, error_reason()}

get/2

get(URI::uri_string:uri_map(), Opts::options()) -> {ok, [resp_hdr()], binary()} | {error, error_reason()}


Generated by EDoc