Downstream v1.0.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()) ::
  {:ok, Downstream.Response.t()} | {:error, Downstream.Error.t()}

Downloads from a given URL with a GET request.

Returns {:ok, %Downstream.Response{}} if the download is successful, and {:error, %Downstream.Error{}} otherwise.

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

If the request succeeds, a Downstream.Response struct is returned.

Link to this function

post(url, io_device, body \\ "", options \\ []) View Source
post(binary(), IO.device(), binary() | {atom(), any()}, Keyword.t()) ::
  {:ok, Downstream.Response.t()} | {:error, Downstream.Error.t()}

Downloads from a given URL with a POST request.

Returns {:ok, %Downstream.Response{}} if the download is successful, and {:error, %Downstream.Error{}} otherwise.

Link to this function

post!(url, io_device, body \\ "", options \\ []) View Source

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

If the request succeeds, a Downstream.Response struct is returned.