I am using Apache-CXF to create REST web services and trying to submit a form.
Server:
This is my method which is expected to receive json data.
@POST @Path("/addCustomer/") @Consumes(MediaType.APPLICATION_JSON) //{"Customer":{"name":"Some Name","id":6}} public Customer addCustomer(Customer customer){ logger.debug(customer); return customer; }
Client: I use the firefox REST plugin to send the request: Using the REST client, I sent the following json as the request body:
{"Customer":{"name":"Arnav Awasthi","id":6}}
But I get "415: Unsupported Media Type" .
Arnav source share