falcon

Types

pub opaque type Client
pub type FalconError =
  core.FalconError
pub type FalconResponse(a) =
  core.FalconResponse(a)
pub type ResultResponse(a) =
  core.ResultResponse(a)

Constants

pub const default_timeout: Option(Int) = Some(15_000)

Functions

pub fn delete(
  client client: Client,
  path path: String,
  expecting target: Target(a),
  options opts: List(Config),
) -> Result(FalconResponse(a), FalconError)
pub fn extract_headers(
  opts: List(Config),
) -> List(#(String, String))
pub fn get(
  client client: Client,
  path path: String,
  expecting target: Target(a),
  options opts: List(Config),
) -> Result(FalconResponse(a), FalconError)
pub fn merge_opts(
  client: Client,
  opts: List(Config),
) -> List(Config)

This is used internally to merge the client options with the request options, it is only exposed for testing purposes

pub fn new(
  base_url base_url: Url,
  headers headers: List(#(String, String)),
  timeout timeout: Option(Int),
) -> Client
pub fn patch(
  client client: Client,
  path path: String,
  body body: String,
  expecting target: Target(a),
  options opts: List(Config),
) -> Result(FalconResponse(a), FalconError)
pub fn post(
  client client: Client,
  path path: String,
  body body: String,
  expecting target: Target(a),
  options opts: List(Config),
) -> Result(FalconResponse(a), FalconError)
pub fn put(
  client client: Client,
  path path: String,
  body body: String,
  expecting target: Target(a),
  options opts: List(Config),
) -> Result(FalconResponse(a), FalconError)
pub fn send(
  client client: Client,
  method method: Method,
  path path: String,
  expecting target: Target(a),
  options opts: List(Config),
) -> Result(FalconResponse(a), FalconError)

A way to send a request with a client, you would normally want to use the convenience functions (get, post, put, patch, delete) instead

Search Document