Hi
This is what I do:
@HttpMethod(value = "POST")
@ConsumeMime(value = "application/atom+xml;type=entry")
public Response postEntry(Entry entry) {
.....
return Response.Builder.created(uri).lastModified(new Date
()).build();
}
I get most of my inspiration from the Atomstore example project, a
lot of answers are found in the example projects.
Cheers
su./hail
On Oct 23, 2007, at 8:39 PM, Florian Rosenberg wrote:
> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>