synapsestudios / fetch-client

http client library based on fetch
MIT License
9 stars 3 forks source link

Update DELETE request to take body #125

Open agerbens opened 3 years ago

agerbens commented 3 years ago

A DELETE request may have a body, and fetch allows it, so let's update the DELETE method so it can optionally take a body.

https://tools.ietf.org/html/rfc7231#section-4.3.5

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.

Similar issue: https://github.com/synapsestudios/fetch-client/issues/58. This was filed separately since fetch still seems to throw an error when including a body in a GET.