I've created a raw socket and am sending headers in the correct format, as far as I know.
The problem I have is that for some types of webpages, I recieve a 302 (Temporarily moved, I believe) error from the other server.
This has happened when the link is something like: archive.php/foo/bar/index.html
GET /archive.php/foo/bar/index.html HTTP/1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
Host: www.example.com
Referer:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: none
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Note: I'm using raw sockets as I use the stream_select() function. (fork-like behavior for http requests)
Also, I use "\r\n" for new lines and "\r\n\r\n" for the end of the header.