summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2020-10-21 23:57:11 -0400
committerHubert Chathi <hubert@uhoreg.ca>2020-10-21 23:57:11 -0400
commit760dbbd6bc95cbb597a264ee5320c6af8be12695 (patch)
treeb0bc5695c2d43a452bd7c8c076ecbbfb13a6d1a6
parentrelease 0.3.0 (diff)
add a method to create delete requests
-rw-r--r--lib/polyjuice/client/endpoint.ex9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/polyjuice/client/endpoint.ex b/lib/polyjuice/client/endpoint.ex
index 66a97a9..7869ec6 100644
--- a/lib/polyjuice/client/endpoint.ex
+++ b/lib/polyjuice/client/endpoint.ex
@@ -95,6 +95,15 @@ defmodule Polyjuice.Client.Endpoint do
create(:put, prefix, path, send_json(), opts)
end
+ @doc """
+ Create a `DELETE` request.
+
+ See `get/3`.
+ """
+ def delete(prefix, path, opts \\ []) when is_binary(path) and is_list(opts) do
+ create(:delete, prefix, path, accept_json(), opts)
+ end
+
defp create(method, prefix, path, default_headers, opts) do
prefix =
case prefix do