Skip to content

Commit

Permalink
Add new clause to empty strings for Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ksriness authored Nov 1, 2022
1 parent c892ddc commit 281798a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/mater.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ defmodule Mater do
opts :: Keyword.t()
) :: {:ok, response :: map()} | {:error, reason :: map()}

def call("", _, _),
do: {:error, :nxdomain}
def call(endpoint, body, opts \\ []) do
case HTTPoison.post(endpoint, Jason.encode!(body), decode_opts(opts)) do
{:ok, %HTTPoison.Response{body: body, status_code: 200}} ->
Expand Down

0 comments on commit 281798a

Please sign in to comment.