users@jersey.java.net

Adding a resource - HTTP POST

From: Florian Rosenberg <florian_at_vitalab.tuwien.ac.at>
Date: Tue, 23 Oct 2007 14:39:05 -0400 (EDT)

Hi,

I'm currently unit testing my resources. I have problems understanding the
return code of a POST, for example, here is my method signature:

@UriTemplate("customers/{id}")
@HttpMethod("POST")
public void addCustomer(@UriParam("id") String id, Customer data) {}

Upon execution, the resource is created and returns a 204 code, which
means "No content". This seems okay, but I rather expected a 201 "Created"
response.

Is this the default return code for a successful HTTP POST? I checked the
JavaDoc API, but I could not find any annotation that would allow me to
set the return code I want to have.

Thanks,
-Florian