Hexoku.Request

Make generic Heroku HTTP requests.

You can use this for making API requests to API endpoints that are still to be supported by Hexoku.

Examples:

client = Hexoku.toolbelt
client |> Hexoku.Request.get("/apps")
Source

Summary

delete(client, path)
delete(url, headers \\ [], options \\ [])
get(client, path)
get(url, headers \\ [], options \\ [])
head(client, path)
head(url, headers \\ [], options \\ [])
options(client, path)
options(url, headers \\ [], options \\ [])
patch(client, path, body)
patch(url, body, headers \\ [], options \\ [])
post(client, path, body)
post(url, body, headers \\ [], options \\ [])
put(client, path, body)
put(url, body, headers \\ [], options \\ [])
request(method, url, body \\ "", headers \\ [], options \\ [])

Sends an HTTP request. Args:

  • method - HTTP method, atom (:get, :head, :post, :put, :delete, etc.)
  • url - URL, binary string or char list
  • body - request body, binary string or char list
  • headers - HTTP headers, orddict (eg. [{:Accept, "application/json"}])
  • options - orddict of options Options:
  • timeout - timeout in ms, integer Returns HTTPoison.Response if successful. Raises HTTPoison.HTTPError if failed
start()

Start httpoison and dependencies

transformer(target)

Types

headers :: %{} | [{binary, binary}]

Functions

delete(client, path)

Specs:

Source
delete(url, headers \\ [], options \\ [])

Specs:

  • delete(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
get(client, path)

Specs:

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

Specs:

  • get(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
head(client, path)

Specs:

Source
head(url, headers \\ [], options \\ [])

Specs:

  • head(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
options(client, path)

Specs:

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

Specs:

  • options(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
patch(client, path, body)

Specs:

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

Specs:

  • patch(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
post(client, path, body)

Specs:

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

Specs:

  • post(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
put(client, path, body)

Specs:

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

Specs:

  • put(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
request(method, url, body \\ "", headers \\ [], options \\ [])

Specs:

  • request(atom, binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t

Sends an HTTP request. Args:

  • method - HTTP method, atom (:get, :head, :post, :put, :delete, etc.)
  • url - URL, binary string or char list
  • body - request body, binary string or char list
  • headers - HTTP headers, orddict (eg. [{:Accept, "application/json"}])
  • options - orddict of options Options:
  • timeout - timeout in ms, integer Returns HTTPoison.Response if successful. Raises HTTPoison.HTTPError if failed.
Source
start()

Start httpoison and dependencies.

Source
transformer(target)

Specs:

  • transformer(pid) :: :ok
Source