|
Posted by gentleJuggernaut on 12/05/07 15:45
I am using curl to access a webservice. The webservice offers a
search and confirm. The search works great. on the confirm there is
a value that needs to be passed back to the webservice in order to
confirm. This value often contains '+%20' etc. Curl appears to be
changing these values to spaces. Is there a curl option that will
tell it not to encode the data, just pass it as is.
Here is the cURL code that I am working with:
$ch = curl_init ();
$fp = @fopen('out.txt','w');
$postdata = 'serviceRequest=' . $xml;
curl_setopt ($ch, CURLOPT_URL,$this->getGateway($test));
curl_setopt ($ch, CURLOPT_TRANSFERTEXT,true);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_VERBOSE, true);
curl_setopt ($ch, CURLOPT_TIMEOUT, $this->getTimeout($test));
@curl_setopt ($ch, CURLOPT_STDERR, $fp);
$result = curl_exec ($ch);
curl_close($ch);
@fclose($fp);
the variable $xml contains my well formed xml request (I have verified
this separately). When the server (represented by $this-
>getGateway($test)) receives my xml statement with altered text (when
I compare what the server receives with what I had prior to putting it
through cURL some of the data contained in the xml has been
reformatted with spaces in place of certain characters, referenced
above). This of course causes the confirmation to fail. Any help
would be appreciated.
NSM
Navigation:
[Reply to this message]
|