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,