diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2020-10-21 23:57:11 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2020-10-21 23:57:11 -0400 |
commit | 760dbbd6bc95cbb597a264ee5320c6af8be12695 (patch) | |
tree | b0bc5695c2d43a452bd7c8c076ecbbfb13a6d1a6 | |
parent | release 0.3.0 (diff) |
add a method to create delete requests
-rw-r--r-- | lib/polyjuice/client/endpoint.ex | 9 |
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 |