Hello all,

you can also adopt this form:

@Post
public Representation postHandler(Form form) throws ResourceException {
  // Rest of the handler here
}

Best regards,
Thierry Boileau

You are welcomed.
>
> One thing I forgot: if you want to add an extra-level of robustness to
> your POST handler, you can add a check for null entities (POST
> 'nothing') and throw new
> ResourceException(Status.CLIENT_ERROR_BAD_REQUEST) for example (HTTP
> 400), when the entity you receive is null:
>
> @Post
> public Representation postHandler(Representation entity) throws
> ResourceException {
>  if (entity == null) {
>    throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,
> "Cannot POST 'nothing'!!!");
>  }
>  // Rest of the handler here
> }
>
> Good luck!
>
> On Mon, May 2, 2011 at 8:16 PM, aquestion10
> <[email protected]> wrote:
> > Thanks a lot. That really helped me. This information was what I was
> looking for.
> >
> > ------------------------------------------------------
> >
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2728490
> >
>
>
>
> --
> Fabián Mandelbaum
> IS Engineer
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2728685
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2730096

Reply via email to