-
Feature Request
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
Undefined
REST Client does not allow GET requests with a body, failing with:
Caused by: javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request: javax.ws.rs.ProcessingException: RESTEASY004565: A GET request cannot have a body.
at org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine.invoke(ManualClosingApacheHttpClient43Engine.java:287)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:488)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:65)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.method(ClientInvocationBuilder.java:322)
As per RFC 7231
A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request.
Hence the RFC admits that a GET request may have a body. In my opinion, the Client implementation should therefore not prevent it artificially. Curiously, there is no problem to make a JAX-RS endpoint which accepts a GET request with a body… so it is then surprising that the JAX-RS Client can't send such a request.