I think that Jersey only allows a single method for each unique @Path
& @VERB
pair, meaning that you'll either need to have one of those things use a different verb (POST and PUT) or you need two different paths. Before you just go and make one POST and the other PUT, make sure you understand how to properly use verbs in REST.
Jersey switch on Content Type dynamically
문제
A similar question is here: Supporting both Multipart and Application Url Encoded parameters in Jersey
I have an API endpoint (in Jersey) that can accepts POST request. The content types are either: form-urlencoded, or multipart. The two types of request arrive at the same path. How do I switch on that?
For the urlencoded request, I want to get argument:
@FormParam("recipient") String recipient
For multipart request, I want to get:
@FormDataParam("file") InputStream uploadedInputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail
Thanks!
해결책
제휴하지 않습니다 StackOverflow