Java/Quarkus how to identify the Content-type of the incoming request #24934
-
Hello, I am developing a Rest-API application using Java/Quarkus. My POST API accepts XML/JSON contents. I would like to identify the type of MediaType of the incoming data based on which I need to make a request to another API by setting the appropriate Following is the code I have so far:
As you can see my Based on the As of now, the function is working accurately for JSON but I am unable to handle the XML Input. Can someone please let me know how can I find the incoming Input MediaType? I am unable to understand how to do it for the Quarkus-based application? I would like to handle this within this application rather than handling in the external application. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found the answer, posting here as it can be useful to someone else in the future:
|
Beta Was this translation helpful? Give feedback.
Found the answer, posting here as it can be useful to someone else in the future: