Hi Jakkrit and Christian, This is the expected behavior, due to the fact that HTTP requires us to write the "Content-Length" header before actually writing the representation content.
If you want to delay the size computation after construction of the object, you can try to either override the OutputRepresentation#getSize() method or to leverage the ConnectorService#beforeSend(Representation) method. Again, this isn't necessary when leveraging chunked encoding. Best regards, Jerome -- http://www.restlet.org http://twitter.com/#!/jlouvel -----Message d'origine----- De : Christian Wuertz [mailto:[email protected]] Envoyé : dimanche 1 janvier 2012 10:53 À : [email protected] Objet : RE: Content-Length is missing after calling setSize() in OutputRepresentation reponse I've the same problem. If I set the size in the constructor, it will be used as content-length parameter in the HTTP header. But if I use setSize() in the write() method it has no effect and no content-length parameter is added to the HTTP header. ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=29034 01 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2903571

