I just started implementing REST with JAX-RS this week. Working
through the examples in the RESTful Java text by Burke.
Successful in querying data from a PostgreSQL database using GET
methods from an iOS client. Have also been able to create new records
using POST, but can't seem to figure out how to read/parse the
javax.ws.rs.core.Response from my POST method. Trying to read the
response to verify if the POST (create) was successful.
@POST
@Consumes("application/xml")
public Response createCustomer(Customer customer) {
//code here to create a new Customer record...(this part is
working)
return Response.created(URI.create("/customers/" +
customer.getId())).build();
}
When I read the response in my iOS client...nothing shows up. Assuming
that the return value is XML. Do I need to change the return
type...aka build/return an actual XML String?
Any advice would be appreciated.