sending a http request with post
Posted: Wed May 15, 2002 11:39 am
I need to send a post request to a remote server and receive an xml doc in response. Iunderstand that I need to use header() but keep getting a 500 (Internal Server) error - in the server log it says "bad header". This is the header I want to send:
and I tried to send to the remote server with this code:
Any help much appreciated!
Code: Select all
POST /xmlapi HTTP/1.0
Cookie: pgfh354=encrypted_password
Content-type: application/x-www-form-urlencoded
Content-Length: 654654
XMLREQUEST=URL_encoded_XML_docCode: Select all
<?php
header("Location: http://remotehost");
header("PORT: 80");
header("POST /xmlapi HTTP/1.0");
header("Cookie: PSpcV310=encrypted_password");
header("Content-type: application/x-www-form-urlencoded");
header("Content-length: content_length");
header("XMLREQUEST=encoded_XML_document\n");
?>