views:

64

answers:

3

Hi there,

I am currently developing a HTTP server.

When a client requests a PNG, my response headers are properly formatted and respond with Content-Type : image/png

What steps and encoding processes do I have to perform on my .png file to send it as a byte[] in the http response body?

Thanks!

+2  A: 

None. Just be nice and send the "Content-length" as well.

Jeff Moser
Thanks, the content-length is sent
divinci
I am a bit flumuxed as my responce is a simple on with the correct headers, followed by \r\n\r\n then the byte[] of the png file. IE and Firefox don't like it ?:/
divinci
What language are you using? Can you post your code in the question?
Jeff Moser
+1  A: 

None, unless specified by the Transfer-Encoding HTTP header.

It is all very well-documented.

molf
+1  A: 

As others have said, none, HOWEVER, for extra credit your server should check if the client accepts gzip encoding (look at the 'accept-encoding' header) when sending text or xml documents (images are compressed already) and send gzip with a content-encoding header.

Also accept, accept-charset and accept-language should be respected.

All are documented in RFC2616 (HTTP 1.1)

SpliFF