Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Tim Holloway wrote:OK, here's what it looks like.
You're using @GetMapping. First of all, that's for GET requests. For POST, you'd use @PostMapping.
Secondly, and more important, I think those annotations are for the SERVER, not the client!
The client should be using something like this:
Stephan van Hulst wrote:This isn't strange at all.
GET requests don't have a body.
If you want to send a body with your request, it MUST use a method other than GET.
Al Matevski wrote:I don't think it's a MUST, at least not on a technical level. Why the protocol doesn't cut the request body if it's a MUST that GET should not have a request body?
Imagine Postman, for example, not sending a GET request with a request body because, it's convention to not send a request body with GET.
Or worse, imagine Postman silently converting the GET request in a POST request. :mindblow:
I can't think of a single reason that a library for a http client must forbid to send GET request with a request body.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Tim Holloway wrote:And, again, I think that you're using the wrong annotation for a client. I can find absolutely no examples of a FeignClient using @GetMapping, including in the Spring docs themselves. @GetMapping is a server annotation.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Tim Holloway wrote:https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1
So a GET with a body isn't expressly forbidden.
IF you like to live dangerously.
Bear in mind also that just because the destination server would accept a GET with a payload doesn't mean that an intermediate stage (load balancer, firewall with packet inpection, etc.) might not have other ideas.
Tim Holloway wrote:https://github.com/spring-cloud-samples/feign-eureka/blob/main/client/src/main/java/demo/HelloClientApplication.java
Al Matevski wrote:
Why are you so stubborn
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|