Hi,
I am in the process of developing a REST API using JAX-RS.
The incoming request to the endpoint contains a JSON payload which needs to
be processed.
Currently I am using the following approach to access the payload
@Path("/rpt")
public class UmaAuthorizationEndpoint {
private static final Log log =
LogFactory.getLog(UmaAuthorizationEndpoint.class);
@POST
@Path("/")
@Consumes("application/json")
@Produces("application/json")
*public Response issueRPT(@Context HttpServletRequest
request,@Multipart(value="application/json") String jsonPayload){*
*// rest of the code*
*}*
I am using the @Multipart annotation to get the payload as a String and
continue with parsing the JSON.
Is this the usual approach? If not, Is there an alternative approach to do
this?
--
*A.Farasath Ahamed*
Undergraduate | Department of Computer Science and Engineering,University
of Moratuwa
Article Writer | MoraSpirit
Mobile: +94 777 603 866
Blog: http://thepseudocode.blogspot.com
E-Mail: [email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev