Hello everyone,

Is it relevant to annotate a @GET method with @Consumes knowing that it's not 
advised to have a payload for HTTP GET request even if it is not forbidden by 
the specification if I have well understood  ?

I ask this question because I have performed some tests with TomEE 8.0.14 and I 
am a little bit surprised.
Indeed I have annotated an @GET method with @Consumes ( { 
MediaType.TEXT_PLAIN}).
Then I sent a GET request using curl with a Content-Type set to 
application/json.
I was expecting  to get a 415 but in fact everything worked fine.

Does it means that there is no check  between the Content-Type value and the 
@Consumes media types for HTTP GET methods ?
meaning that @Consumes for HTTP GET methods is useless ?

Best Regards.



Reply via email to