On Thu, 2006-08-24 at 14:29 +0000, Doug Lochart wrote:
> >
> >
> > The restriction is in place because "content" may be a stream that
> > creates data on the fly and is not repeatable. In particular, neither
> > client nor server will send the message body twice. If you want to
> > modify content, you can either wrap a stream that modifies on the fly,
> > or you can use a BufferedEntity that will keep the content in memory
> > all at once. The latter will cause problems if content is large.
> >
> > hope that helps,
> >   Roland
> 
> 
> 
> I still have a bit of confusion so a little more "basic" information might
> clear my head.   I guess when I look at it I see that I have a response
> object and inside is the entity (content).  To me it looks as if the entire
> data should already be in the reposne (I see this is not the case but it is
> how I was thinking last night).  So what you are saying is that the response
> will have headers but the actual content "may" reside on the other end of an
> InputStream ?  Meaning that the content (probably dynamic) will not be
> rendered by the remote application until I physically read the data from
> InputStream ?  Is this the case?
> 

Doug,
Please consider a situation where the server has to send back to the
client several megabyte of content in the response body. Most likely one
would not want to have all that content buffered in memory. Such
architecture simply will not perform and scale.

Therefore HttpCore uses an abstract HttpEntity interface to represent an
entity. Those entities can be static, whose content is fully contained
in the entity itself, or "streaming", that is producing content on fly.

One can (and should) assemble a response object that contains only
response status line, headers and a reference to an HttpEntity that will
be used to produce the desired content while the response is being
streamed out to the client.

Hope that makes things somewhat clearer. 

Oleg

> I guess I assumed if you have response headers then you would have the
> content as I thought it comes all at once from the remote web server.  Could
> you simply explain this process or point me to something that might explain
> it clearly?
> 
> thanks again!
> 
> Doug
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to