Downstream v0.1.0 Downstream View Source

Downstream is an Elixir client for streaming downloads via GET or POST requests, by relying on HTTPoison.

Downstream is simple to use, just pass it a URL and an IO device:

Link to this section Summary

Functions

Downloads from a given URL with a GET request

Downloads from the given URL with a GET request, raising an exception in the case of failure

Downloads from a given URL with a POST request

Downloads from the given URL with a POST request, raising an exception in the case of failure

Link to this section Functions

Link to this function get(url, io_device, options \\ []) View Source
get(binary(), IO.device(), Keyword.t()) :: {atom(), binary()}

Downloads from a given URL with a GET request.

Returns {:ok, io_device} if the download is successful, and {:error, reason} otherwise.

Link to this function get!(url, io_device, options \\ []) View Source
get!(binary(), IO.device(), Keyword.t()) :: binary()

Downloads from the given URL with a GET request, raising an exception in the case of failure.

If the request succeeds, the IO device is returned.

Link to this function post(url, io_device, body \\ "", options \\ []) View Source
post(binary(), IO.device(), binary() | {atom(), any()}, Keyword.t()) ::
  {atom(), binary()}

Downloads from a given URL with a POST request.

Returns {:ok, io_device} if the download is successful, and {:error, reason} otherwise.

Link to this function post!(url, io_device, body \\ "", options \\ []) View Source
post!(binary(), IO.device(), binary() | {atom(), any()}, Keyword.t()) ::
  binary()

Downloads from the given URL with a POST request, raising an exception in the case of failure.

If the request succeeds, the IO device is returned.