I need to retrieve the json text input of the body of the post request..
I use javax.ws.rs.*
This is my code ..:
@POST
@Consumes(value = MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public Response postProduct(final Product product)
{
try
{
// I want to retrieve the json text of the post request body here.
if (null == product) // In case of an empty "product"
{
return Response.status(Response.Status.BAD_REQUEST).entity("No data").build();
}
....
This is the json body that I want to retrieve in my method :
{
"productNumber":"65421",
"ExpirationDate":"2023-12-31",
"supplier":"yyy"
} ```
Thanks a lot in advance..