Closed ojus93 closed 6 years ago
It's absolutely intentional, yes. Yes we can send data with DELETE http request, but isn't recommended and almost all of the other libraries for such things you can see same check too.
There's a note in the readme too and you can disable this behavior with strict: false
.
Okay will check for an alternate solution. Closing this issue. Thanks for the quick reply.
Body or fields not reflecting the data passed in request params for route type DELETE.
Issue : No data is being accepted in the request in json or form data or any other format for that matter.
Reason: After evaluating the library saw that in utils file there is validity check of method which is not allowing the data to be set in fields/body. PFB the function : utils.isValid = function isValid (method) { return ['GET', 'HEAD', 'DELETE'].indexOf(method.toUpperCase()) === -1 }
I think , this function should not have DELETE method, as by the HTTP protocol, we can send data in the DELETE API. Let me know, if I should send a PR to fix this, or there is something else that I can do to handle this.