Method annotated with @GET questions

COURTAULT Francois <[email protected]>
Newsgroups gmane.comp.java.openejb.user
Message-ID <MR1P264MB23551185E5F3E451858BB4EB9DBD9@MR1P264MB2355.FRAP264.PROD.OUTLOOK.COM>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.