1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.ReverseProxy.Client.Hackney do
6 @behaviour Pleroma.ReverseProxy.Client
9 def request(method, url, headers, body, opts \\ []) do
10 :hackney.request(method, url, headers, body, opts)
14 def stream_body(ref) do
15 case :hackney.stream_body(ref) do
17 {:ok, data} -> {:ok, data, ref}
18 {:error, error} -> {:error, error}
23 def close(ref), do: :hackney.close(ref)