Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
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.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
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.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
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![]()
![]()
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Please do not shoot the fish in this barrel. But you can shoot at this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|