Hello Rick,

the acceptRepresentation method is the handler of POST requests, on the 
server side. It means that the client has sent an entity (with a given 
media type), and hopes that a series of instructions will take care of 
it in order to update the resource's state.
The "acceptRepresentation" is responsible to validate the format and the 
content of the sent entity. Thus I think that it's always a good idea to 
check the entity's media type.

best regards,
Thierry Boileau

> Hi,
>    I'm using Restle 1.1.4. In acceptRepresentation method, I would like to 
> know when do we need to add the below condition?
>
> if (entity.getMediaType().equals(MediaType.APPLICATION_WWW_FORM, true)) {
>
> Basically, I know that if we add this condition, then the client needs to set 
> the content type to "application/x-www-form-urlencoded", otherwise, it cannot 
> accesst it. However, even if I don't add above code, it would work fine with 
> text/xml content type.
>
> My question is under what circumstances do we need to add the above 
> condition? Is it a good idea to put this condition or a bad idea?
>
> Thanks!
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2059445
>
>

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

Reply via email to