Yaniv Golan
Yaniv Golan

Reputation: 982

getting the POST request from web server

I'm having troubles debugging a POST request I'm making from my web server to another web server.
I'm trying to communicate with a SOAP web service but from some reason a code that worked well from local machine fails when executing on my server
Looking for a way to see the post request my server make to the web service server
web server OS - CentOs
using PHP curl to make the request
Ideas anyone?

Upvotes: 0

Views: 434

Answers (5)

Kniganapolke
Kniganapolke

Reputation: 5403

I had the same problem, and using CURLINFO_HEADER_OUT made outgoing request headers show up in debug info.

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
$data = curl_exec($ch);
var_dump($data);
$details = curl_getinfo($ch);
var_dump($details);

Upvotes: 1

cOle2
cOle2

Reputation: 4784

Redirect the post request to a server you control. You can then read the posted data using echo file_get_contents('php://input');

Upvotes: 0

symcbean
symcbean

Reputation: 48367

Or point your client at:

<?php print_r($_POST); ?>

C.

Upvotes: 0

mazgalici
mazgalici

Reputation: 606

To see the POST on the server

$h=fopen('out.txt','w'); fwrite($h,var_export($_POST,true));

Maybe the curl is disabled on your server

Upvotes: 0

symcbean
symcbean

Reputation: 48367

Wireshark? If you've got to connect to the remote end using SSL, then run a stunnel client on the soap client and route requests through that tapping in between.

Upvotes: 1

Related Questions