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
get(url, io_device, options \\ [])
View Source
get(binary(), IO.device(), Keyword.t()) ::
{:ok, Downstream.Response.t()} | {:error, Downstream.Error.t()}
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.
get!(url, io_device, options \\ [])
View Source
get!(binary(), IO.device(), Keyword.t()) ::
Downstream.Response.t() | Downstream.Error.t()
get!(binary(), IO.device(), Keyword.t()) :: Downstream.Response.t() | Downstream.Error.t()
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.
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()}
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.
post!(url, io_device, body \\ "", options \\ [])
View Source
post!(binary(), IO.device(), binary() | {atom(), any()}, Keyword.t()) ::
Downstream.Response.t() | Downstream.Error.t()
post!(binary(), IO.device(), binary() | {atom(), any()}, Keyword.t()) :: Downstream.Response.t() | Downstream.Error.t()
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.