Skip to content

add support for request body in HTTP DELETE methods using RestClient #32693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
peter-ponzel opened this issue Apr 22, 2024 · 4 comments
Closed
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply

Comments

@peter-ponzel
Copy link

Hello,

currently the RestClient is not supporting request bodies in DELETE requests which is very limiting - especially in cases where additional data beyond URL parameters are needed - such as Remove Roles from Organization Members from Auth0.

Are there any plans to support this in upcoming releases ?

Best regards,
Peter

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 22, 2024
@quaff
Copy link
Contributor

quaff commented Apr 23, 2024

https://www.rfc-editor.org/rfc/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.

Delete with payload is allowed but not recommended.

@peter-ponzel
Copy link
Author

hello @quaff and thank you for responding

it might not be recommended, but the reality shows there is a need for it → the API from Auth0 - linked in my previous comment - simply requires a payload with a DELETE request

this is unfortunately not possible at the moment - which is why I have made a request here

in my opinion it should be up to the consumer who makes the request to decide in what way he makes a request and then let a server decide how to respond to it

@snicoll
Copy link
Member

snicoll commented Apr 23, 2024

this is unfortunately not possible at the moment - which is why I have made a request here

Have you tried restClient.method(HttpMethod.DELETE).body()?

in my opinion it should be up to the consumer who makes the request to decide in what way he makes a request and then let a server decide how to respond to it

That's quite a one-side view of things IMO. Having the spec not recommending this in such terms is a certainly a valid reason for us not exposing a first-class concept for this. Does method help?

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue in: web Issues in web modules (web, webmvc, webflux, websocket) labels Apr 23, 2024
@peter-ponzel
Copy link
Author

Having the spec not recommending this in such terms is a certainly a valid reason for us not exposing a first-class concept for this

this was also mentioned from quaff before ... what makes you come to this conclusion ?
taking the quote from the RFC

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.

I don't see anything saying that it's not recommended

Have you tried restClient.method(HttpMethod.DELETE).body()?

now I have and thank you this one works 👍

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 23, 2024
@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2024
@snicoll snicoll added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

4 participants