I send this request to google.com,
GET /HTTP/1.1
Host: http://www.google.com
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like
Gecko) Chrome/14.0.835.186 Safari/535.1Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charqet: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: NID=51=XHrnCh-WA2BjwFpfjavZ1dxy6JT98N0ojBEtkxBnP9uUEr3cLvm2ETGlr0q0JhWWcgth-z7Dm7J0NU-UpA77SiDtF2rh1DhzRRToW1jA0Ia7HmOzFepL9TdIW9MDacAK; rememberme=true; PREF=ID=5a917ae1d013ee33:U=8c5a025c53669947:FF=0:TM=1317242244:LM=1317291115:GM=1:S=n1cOehpkL6SuVhsK
I get this respond from google:
We’re sorry… but your computer or network may be sending automated queries. To protect our users, we can’t process your request right now
Why do I get this answer? How can I fix this?
It looks like you’re missing a space between the path and version in your request line. The following should work:
It also looks like you have a typo in one of your headers,
Accept-Charqetinstead ofAccept-Charset.Finally, you have extra line breaks between your headers, which will prevent the HTTP server from interpreting your request correctly. You should have a
\r\n(carriage return, line feed) after each header and an addtional\r\nseparating the headers from the body of the request.The corrected request would look like:
Where each line is terminated with
\r\nand there is a empty line terminated with\r\nat the end.