Re: How web server sends images?

You've got almost all of the pieces of the puzzle. The key header that
hasn't been mentioned yet is Content-Length, which tells the client when
to stop reading the binary data. It's a brilliantly simple protocol.

Try doing telnet <site> 80, and issuing a GET or HEAD command, and
you'll see the format of the returned data.

GET <path> HTTP/1.0<CR><CR>

	Scott Orshan
	BEA Systems

Mike Dierken wrote:
> 
> > -----Original Message-----
> > From: Mukul Gandhi [mailto:mukulw3@yahoo.com]
> > Sent: Thursday, May 30, 2002 8:30 PM
> > To: www-talk@w3.org
> > Subject: How web server sends images?
> >
> >
> >
> > I want to know how a standard Web Server(HTTP 1.1)
> > sends image files to the browser.
> The server sends the image data in the body of an HTTP response message,
> after the HTTP response headers.
> 
> > I believe it sends Content-type header to tell the type of content.
> That is the correct behavior.
> 
> > Apart from that how does it actually send the image data?
> As a stream of binary data, in the format specified by the Content-Type
> header.
> For example a Content-Type: of image/jpeg would be in the standard JPEG
> format.
> 
> > What encoding it does,
> In addition to the Content-Type header, it is possible to have a
> Content-Encoding header that specifies that the message body is encoded -
> for example the value 'gzip' indicates a specific compression algorithm.
> It is important to note that the Content-Type header does NOT change when
> encoding has happened - so all clients must be aware of this and examine
> both headers to properly handle/dispatch/whatever the response.
> In addition there is a Transfer-Encoding header which should be interpreted
> by a client library for you automatically.
> 
> > where does it exactly place the data and what delimiters it specifies?
> The body of an HTTP message is separate from the header by a blank line
> (carriage-return/linefeed).
> The header are ASCII. The body is binary, whose format is specified by the
> Content-Type header.
> 
> > Is there any document on Internet which describes this?
> The HTTP 1.1 specification is here:
> http://www.w3.org/Protocols/rfc2068/rfc2068
> 
> >
> > Regards,
> > Mukul
> >

Received on Friday, 31 May 2002 13:42:41 UTC