|
Comments for: joe20000907
| Message # 1013275: |
|
Date: 09/08/02 07:42
By: Richard Hundt Subject: RE: How to POST XML data? sorry guys, in my last post, I included a function that writes HTTP headers and then sends the POST. The Content-Type is wrong, it should read: function request($post_data) { $this->buf = ""; fwrite($this->socket, "POST $this->path HTTP/1.0\r\n". "Host:$this->host\r\n". "User-Agent: $this->agent_name\r\n". "Content-Type: application/xml\r\n". "Content-Length: ".strlen($post_data). "\r\n". "\r\n".$post_data. "\r\n" ); while(!feof($this->socket)) $this->buf .= fgets($this->socket, 2048); $this->close(); return $this->buf; } |
Previous Message | Next Message |


