Simple Http Get Response Simple Http Get Response unix unix

Simple Http Get Response


My first answer is below, but i just noticed something..

"Content-type: text/html \r\n \r\n";

The headers must be separated from the content with two CR/LF. It looks like you have space in there

you can try this:

 "Content-type: text/html\r\n\r\n";

Is the output buffer being correctly flushed and closed after the last write? Try changing the size of your 1024 byte read buffer to something larger than your gif file. This isnt a fix, but you may get different results, and this may help track down the cause of the problem. Maybe also put some logging into the read write loop. See if the size of the last buffer write equals the number of bytes the response is missing.