
August 12th, 2005, 03:39 PM
|
|
|
|
Join Date: Apr 2007
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
http_request troubles
Greetings,
I am using the PEAR package HTTP_REQUEST to send xml to a remote server and receive xml back from that server. Everything is working fine in my dev environment and even on one web host. But I'm running into problems trying to run the same code on a different host's server. The error being returned is "Malformed response". Does anybody know of any differences in server config that may cause such an error?
Here's my testing code (note: $postString is THE XML I'm sending):
php Code:
Original
- php Code |
|
|
|
$req = &new HTTP_Request('https://' . THE_HOST . '/some/path'); $req->setMethod(HTTP_REQUEST_METHOD_POST); $req->addRawPostData($postString); $x = $req->sendRequest(); if (PEAR::isError($x)) { } else { echo $req-> getResponseBody(); }
The expected behaviour is for the response XML tree to be displayed in the browser window. This happens when I run it locally and on one web host's server.
But when I run it on the other web host's server, it displays the error mentioned above.
Would the fact that it is an https request have anything to do with it? I'm not sure if the new server (where I'm receiving the error) is using a proxy or not. If it is and I'm not using the setProxy method, could this be the cause? and if so, how can I find out if the server is using a proxy?
Any suggestions for things to check in the 2nd web host's server config?
|