Skip to content
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

Zuul ignores DELETE request body #949

Closed
MadMichael888 opened this issue Apr 5, 2016 · 12 comments
Closed

Zuul ignores DELETE request body #949

MadMichael888 opened this issue Apr 5, 2016 · 12 comments
Assignees
Labels
Milestone

Comments

@MadMichael888
Copy link

Hi,

I have a spring mvc controller which process DELETE request, the RequestBody of the request has a list of ids. It works fine when running alone. But once I put the service behind a zuul service, the DELETE request body is missing.

Has anyone encountered the same problem?

Thank you,
Mike

Here is the controller method:

@RequestMapping(value = "/test", method = RequestMethod.DELETE)
public ResponseEntity<Void> testDelete(@RequestBody POJO pojo) {
    log.info("Got delete request : {}", pojo);
    return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
}
@MadMichael888
Copy link
Author

The warning msg I got when running behind a zuul server is:

WARN  | 2016-04-05 12:41:23 | [XNIO-2 task-3] support.DefaultHandlerExceptionResolver (DefaultHandlerExceptionResolver.java:377) - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public org.springframework.http.ResponseEntity<java.lang.Void> com.test.controller.Controller.testDelete(com.test.POJO)

@spencergibb
Copy link
Member

What version are you using?

@MadMichael888
Copy link
Author

spring-cloud-starter-zuul version 1.1.0.M5
from spring-boot-starter-parent version: 1.3.3.RELEASE

Thanks,

@jmirc
Copy link
Contributor

jmirc commented May 3, 2016

do you have any news on this? I have the same problem.
Thanks

@MadMichael888
Copy link
Author

No, I had to work around it by putting the body info in url.

@spencergibb
Copy link
Member

You can try using a HttpClientRibbonCommandFactory which doesn't use the old netflix RestClient.

@spencergibb
Copy link
Member

See #918 (comment) for details

@prontera
Copy link

I have encountered the same problem, but HttpClientRibbonCommandFactory does not help me to solve the "Delete Method" problem.

@prontera
Copy link

prontera commented Jul 1, 2016

Great, it works fine without a body, but we want to process the DELETE request with request body in fact(e.g. list of id or anything else).
May it be possible to process a HTTP request with body or available in future version.
Thanks a lot.

@ervansetiawan
Copy link

We do have the same problem. I know that there are a lot of interpretations and discussions regarding this but there are some use cases for us that makes DELETE with a request body a good solution.

I am wondering if Zuul should take an un-opinionated stance on this and let the downstream service make a decision whether DELETE with request body should or should not be allowed.

@spencergibb
Copy link
Member

Previously the ribbon http client failed if delete had a body. Since it is no longer the default, we can probably move this functionality to the specific client implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants