Wink doesn't calculate the Content-Length for these objects. You can either do as you suggested and add the header for each Response object or you can add your own custom provider(s) to calculate the content length if you know something in advanced. However, if Wink were to pre-buffer the response to calculate the size, it would negatively impact performance especially for non-trivial payloads.
On Tue, Jan 25, 2011 at 1:36 AM, shinoj_kk <[email protected]> wrote: > > > I am setting the response as > > Response.entity(InputStream Object), > Response.entity(String Object), > Response.entity(BufferedOutMultiPart Object) > > Does the wink calculate the Content-Length after reading the entire Stream ? > > When I am using the RestClient does the Content-Length will be provided in > the Response Header by apache wink provider classes or do I need to > calculate the Content-Length in resource class and add to Response object as > > Resposne.entity(InputStream Object).header(Content-Length,size) > Response.entity(String Object).header(Content-Length,size) > Response.entity(BufferedOutMultiPart Object).header(Content-Length,size) ? > > Also I am not able to calculate the total bytes for all these types of > objects and mannually add the Content-Length. > > > > > > > > -- > View this message in context: > http://apache-wink-dev.3470905.n2.nabble.com/Content-Length-Response-header-is-not-displayed-for-Response-in-Rest-Client-tp5955971p5957810.html > Sent from the Apache Wink Dev mailing list archive at Nabble.com. > -- @bluk
