httpp/async

Use the async module if you want to fetch data asynchronously


fn fetch() {
  let subject = uri.from_string("https://example.com")
    |> request.from_uri()
    |> async.send_async

  let response = process.receive(subject, 1000)

}

Values

pub fn send(
  req: request.Request(bytes_tree.BytesTree),
) -> Result(
  #(
    hackney.ClientRef,
    process.Subject(response.Response(BitArray)),
  ),
  hackney.Error,
)

Send a request and receive a subject which you can receive to get the response

Search Document