kwhitley / itty-fetcher

An even simpler wrapper around native Fetch to strip boilerplate from your fetching code!
MIT License
99 stars 4 forks source link

Consider treating payload of delete requests similarly to get requests #28

Closed lettucebowler closed 1 year ago

lettucebowler commented 1 year ago

First off want to just say that I am very thankful for the hard work you all have put into this library, it has saved me a great deal of work.

Currently, payload on DELETE requests is put into the body. A body on a delete request is not part of the REST spec, so would it make sense to apply the same logic as to GET requests, and convert the payloads into query parameters? If this is not something deemed worthy of doing, it would be nice to have some way to configure whether the payload should be put int he body or query string. Currently I am trying to apply query parameters on a delete request and it seems the best way right now is to use template strings.

If this is a change people think is worth making, it's a simple one so I would be happy to make it myself if needed.

lettucebowler commented 1 year ago

it's not that big of a deal to just use a urlSearchParams object. I'm closing this