File size: 487 Bytes
8da2481 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | defmodule Plausible.S3.Client do
@moduledoc false
@behaviour ExAws.Request.HttpClient
@impl true
def request(method, url, body, headers, opts) do
req = Finch.build(method, url, headers, body)
case Finch.request(req, Plausible.Finch, opts) do
{:ok, %Finch.Response{status: status, headers: headers, body: body}} ->
{:ok, %{status_code: status, headers: headers, body: body}}
{:error, reason} ->
{:error, %{reason: reason}}
end
end
end
|