Skip to content
Discussion options

You must be logged in to vote

Found the answer, posting here as it can be useful to someone else in the future:

@POST
    @Produces(MediaType.TEXT_PLAIN)
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public String hello(@HeaderParam("Content-Type") String contentType, String data) {
        return String.format("Data: %s%nContent-Type: %s", data, contentType);
    }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Aravinda93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant