Hi Matthieu, This looks weird indeed. Could you open an issue report? http://www.restlet.org/community/issues Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com
-----Message d'origine----- De : [email protected] [mailto:[email protected]] Envoyé : samedi 11 avril 2009 18:59 À : [email protected] Objet : Entity not set when setting it from storeRepresentation Hi everybody, I'm trying to figure out how to handle a PUT on a resource. I have overriden storeRepresentation method, so that it creates a new entity, and replies with the passed entity. Here is the code : @Override public void storeRepresentation(Representation r) throws ResourceException { try { /* Create and store new resource */ getResponse().setStatus(Status.SUCCESS_CREATED); getResponse().setEntity(r); } catch (Exception e) { throw new ResourceException(e); } } @Override public boolean allowPut() { return true; } My problem is, if I build a client to put an entity on this resource, the response contains an empty entity. Here is my test code : Client client = new Client(Protocol.HTTP); Request request = new Request(Method.PUT, "URL for the resource"); request.setEntity(new StringRepresentation("some data")); Response response = client.handle(request); System.out.println(response.getEntity()); This gives me "org.restlet.resource.representation$emptyrepresentat...@87e704". Can someone explain me what I did wrong? Thank you much, Mathieu ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=16521 24 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1732113

