ninenines / gun

HTTP/1.1, HTTP/2, Websocket client (and more) for Erlang/OTP.
ISC License
891 stars 232 forks source link

Proposal to add delete/5 to gun #212

Closed randysecrist closed 4 years ago

randysecrist commented 4 years ago

Any reservations about adding this to the gun module? I can submit a PR if you think it ok ...

-export([delete/5]).

delete(ServerPid, Path, Headers, Body, ReqOpts) ->
    gun:request(ServerPid, <<"DELETE">>, Path, Headers, Body, ReqOpts).
essen commented 4 years ago

It's not OK. The RFC says:

   A payload within a DELETE request message has no defined semantics;
   sending a payload body on a DELETE request might cause some existing
   implementations to reject the request.

So I do not want to provide it. If you really need it somehow you should use gun:headers or gun:request.