Re: fsock sending bad request
| From: | Raditha Dissanayake | Date: | Thu, 23 Oct 2003 17:26:01 +0000 |
| Subject: | Re: fsock sending bad request | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167323@lists.php.net to get a copy of this message | ||
Hi
hey Curt, I missed that one. Daniel have you looked at RFC 2616?
Curt Zirzow wrote:
* Thus wrote daniel@electroteque.org (daniel@electroteque.org):-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar.Hi there the following code doesnt seem to work, i am getting a bad request sent back from the server, what could be the problem of something so simple ? $header .= "POST test.php HTTP/1.0\r\n"; $header.= "Host: host\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= 'Content-Length: ' . strlen($req) . "\n\n"; $header .= "Connection: close\n\n"; $header.= "$req\n"; $header.= "\r\n";The last two lines should be: $header.= "\r\n"; $header.= "$req"; #Note, no \n Make sure all your headers have \r\n endings. Technically the $req is not part of the headers but the actual content to be sent. Curt