finch
Finch API wrapper module.
See the Finch documentation for additional information about the functions.
Types
pub type RequestOption {
PoolTimeout(ms: Int)
RequestTimeout(ms: Int)
}
Constructors
-
PoolTimeout(ms: Int)
-
RequestTimeout(ms: Int)
pub type RequestOptions =
List(RequestOption)
Functions
pub fn build(
req: Request(String),
opts: List(RequestOption),
) -> finch.Request
Build a Finch request that can be run with request/2
or stream/5
.
Note, the HTTP methods CONNECT, TRACE, and Other(String)
are not
supported, and will be converted to GET.
pub fn request(
req: Request,
name: Atom,
) -> Result(Response(String), Exception)
Send a request using the Finch instance with the given name.
pub fn start_link(opts opts: List(InstanceOption)) -> OnStart
Start a new Finch instance with the given options.