Computer Science Canada HTTP/1.1 400 Bad Request, why? |
Author: | greenapplesodaex [ Fri Oct 03, 2008 7:31 am ] | ||
Post subject: | HTTP/1.1 400 Bad Request, why? | ||
Hi, I've been working on my first network asst for some time now, but I get HTTP/1.1 400 Bad Request every time. (i've tried many other website, too)
should I not be using socket or something? these are the exact code format I took from the class lecture. I always get (everything before the response was my debug statement) write to client out socket, the line is: GET / HTTP/1.1 HOST: bbcr.uwaterloo.ca wrote got response HTTP/1.1 400 Bad Request |
Author: | Zeroth [ Fri Oct 03, 2008 8:50 am ] |
Post subject: | Re: HTTP/1.1 400 Bad Request, why? |
Try using a higher level library. There is likely a mistake somewhere in there in your codes, and the higher level libraries don't have it. And by higher level, I mean one where you go Connect(website)->string containing html. |
Author: | btiffin [ Fri Oct 03, 2008 2:18 pm ] |
Post subject: | RE:HTTP/1.1 400 Bad Request, why? |
Try changing HOST: to Host: and I'm not sure if CRLF is the same as LF in http, so try without the \r 's as well. Cheers Edits; can't spell today |
Author: | greenapplesodaex [ Fri Oct 03, 2008 3:29 pm ] |
Post subject: | Re: HTTP/1.1 400 Bad Request, why? |
didnt see mto work... i guess i have to email the tutor edit: got it Quote: Ensure that your HTTP request ends with a sequence of "\r\n\r\n". Otherwise web-servers will ignore your requests. |