Module pe4kin_http

abstract API for HTTP client.

Description

abstract API for HTTP client

Data Types

disposition()

disposition() = {Disposition::binary(), Params::[{binary(), iodata()}]}

multipart()

multipart() = [{file, file:name_all(), disposition(), req_headers()} | {Name::binary(), Payload::binary(), disposition(), req_headers()} | {Name::binary(), Payload::binary()}]

path()

path() = iodata()

req_body()

req_body() = binary() | iodata() | {form, #{binary() => binary()}} | {json, pe4kin:json_value()} | {multipart, multipart()}

req_headers()

req_headers() = [{binary(), iodata()}]

response()

response() = {non_neg_integer(), [{binary(), binary()}], iodata()}

Function Index

get/1
json_decode/1
json_encode/1
open/0
open/3
post/3
start_pool/0
stop_pool/0

Function Details

get/1

get(Path::iodata()) -> response() | {error, any()}

json_decode/1

json_decode(Body::binary()) -> pe4kin:json_value()

json_encode/1

json_encode(Struct::pe4kin:json_value()) -> binary()

open/0

open() -> any()

open/3

open(Transport, Host, Port) -> any()

post/3

post(Path::path(), Headers::req_headers(), Body::req_body()) -> response() | {error, any()}

start_pool/0

start_pool() -> any()

stop_pool/0

stop_pool() -> any()


Generated by EDoc