Hi Marco,

The error is basically raised because that's required by the spec [1].

But it's right that the RFC2616 doesn't explicitly forbid DELETE requests with bodies, so we could possibly get rid of the check.

So I guess you’ve stumbled upon an API that expects a payload with DELETE?

Cheers
Christian

[1] http://expath.org/spec/http-client#d2e104




Marco Lettere <m.lettere@gmail.com> schrieb am Sa., 12. Juni 2021, 11:48:
Dear all,

I have to call an API which model an HTTP DELETE operation based on the
body of the request.

It looks like currently http:send-request is not allowing body to be
present ("Body not expected for method DELETE.").

I feel that this is bit too restrictive interpretation of the spec which
states (as far as I recall) that there is no defined semantic for the
operation but not that it is forbidden.

Is there any possibility to relax this behaviour and allow for bodies in
DELETE calls? [1]

Thank you very much.

Marco.


[1]
https://github.com/BaseXdb/basex/blob/382c8097afb1ec5bac1e9511a2287686c33f669d/basex-core/src/main/java/org/basex/util/http/HttpRequestParser.java