DigOc.Request

Source

Summary

delete!(url, headers \\ [], options \\ [])
delete(url, headers \\ [], options \\ [])
delreq(path)
get!(url, headers \\ [], options \\ [])
get(url, headers \\ [], options \\ [])
head!(url, headers \\ [], options \\ [])
head(url, headers \\ [], options \\ [])
options!(url, headers \\ [], options \\ [])
options(url, headers \\ [], options \\ [])
patch!(url, body, headers \\ [], options \\ [])
patch(url, body, headers \\ [], options \\ [])
post!(url, body, headers \\ [], options \\ [])
post(url, body, headers \\ [], options \\ [])
postreq(path, body)
process_request_headers(headers)
process_response_body(body)
process_url(url)
put!(url, body, headers \\ [], options \\ [])
put(url, body, headers \\ [], options \\ [])
putreq(path, body)
req(path)
request!(method, 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
  • stream_to - process id to stream the response
start()

Start httpoison and dependencies

transformer(target)

Types

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

Functions

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

Specs:

  • delete(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Source
delete!(url, headers \\ [], options \\ [])

Specs:

  • delete!(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
delreq(path)
Source
get(url, headers \\ [], options \\ [])

Specs:

  • get(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Source
get!(url, headers \\ [], options \\ [])

Specs:

  • get!(binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
head(url, headers \\ [], options \\ [])

Specs:

  • head(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Source
head!(url, headers \\ [], options \\ [])

Specs:

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

Specs:

  • options(binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Source
options!(url, headers \\ [], options \\ [])

Specs:

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

Specs:

  • patch(binary, binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Source
patch!(url, body, headers \\ [], options \\ [])

Specs:

  • patch!(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
post(url, body, headers \\ [], options \\ [])

Specs:

  • post(binary, binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Source
post!(url, body, headers \\ [], options \\ [])

Specs:

  • post!(binary, binary, headers, [{atom, any}]) :: HTTPoison.Response.t | HTTPoison.AsyncResponse.t
Source
postreq(path, body)
Source
process_request_headers(headers)
Source
process_response_body(body)
Source
process_url(url)
Source
put(url, body, headers \\ [], options \\ [])

Specs:

  • put(binary, binary, headers, [{atom, any}]) :: {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t} | {:error, HTTPoison.Error.t}
Source
put!(url, body, headers \\ [], options \\ [])

Specs:

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

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.

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

Start httpoison and dependencies.

Source
transformer(target)

Specs:

  • transformer(pid) :: :ok
Source