# Membrane Multimedia Framework: HTTPoison Element

This package provides elements that can be used to read files over HTTP using
[HTTPoison]( library.

It is part of [Membrane Multimedia Framework](

## Installation

Add the following line to your `deps` in `mix.exs`.  Run `mix deps.get`.

{:membrane_element_httpoison, "~> 0.1"}

## Sample usage

This should get you a kitten from imgur and save as `kitty.jpg`.

defmodule HTTPoison.Pipeline do
  use Membrane.Pipeline
  alias Pipeline.Spec
  alias Membrane.Element.File
  alias Membrane.Element.HTTPoison

  @impl true
  def handle_init(_) do
    children = [
      httpoison_src: %HTTPoison.Source{location: ""},
      file_sink: %File.Sink{location: "kitty.jpg"},
    links = %{
      {:httpoison_src, :source} => {:file_sink, :sink}

    {{:ok, %Spec{children: children, links: links}}, %{}}