DigOc.Request
SourceSummary↑
Types ↑
headers :: %{} | [{binary, binary}]
Functions
Specs:
- delete(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Specs:
- delete!(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Specs:
- get(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Specs:
- get!(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Specs:
- head(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Specs:
- head!(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Specs:
- options(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Specs:
- options!(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Specs:
- patch(binary, binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Specs:
- patch!(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Specs:
- post(binary, binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Specs:
- post!(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Specs:
- put(binary, binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Specs:
- put!(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Specs:
- request(atom, binary, binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.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
- stream_to - process id to stream the response
Returns {:ok, Response} or {:ok, AsyncResponse} if successful. {:error, Error} otherwise.
Start httpoison and dependencies.
Specs:
- transformer(pid) :: :ok