View Source Bonfire.Common.HTTP (bonfire v0.3.5-classic-beta.10)

Module for building and performing HTTP requests.

Link to this section Summary

Link to this section Types

@type t() :: Bonfire.Common.HTTP

Link to this section Functions

Link to this function

delete(url, body \\ "", headers \\ [], options \\ [])

View Source

Makes a DELETE request

see request/5

Link to this function

get(url, headers \\ [], options \\ [])

View Source

Makes a GET request

see request/5

Link to this function

patch(url, body, headers \\ [], options \\ [])

View Source

Makes a PATCH request

see request/5

Link to this function

post(url, body, headers \\ [], options \\ [])

View Source

Makes a POST request

see request/5

Link to this function

put(url, body, headers \\ [], options \\ [])

View Source

Makes a PUT request

see request/5

Link to this function

request(method, url, body \\ "", headers \\ [], options \\ [])

View Source

Builds and perform http request.

Arguments:

method - :get, :post, :put, :delete url body headers - a keyworld list of headers, e.g. [{"content-type", "text/plain"}] options - custom, per-request middleware or adapter options

Returns:

{:ok, %Tesla.Env{}} or {:error, error}