You are here: Re: cURL changes passed post fields « PHP Programming Language « IT news, forums, messages
Re: cURL changes passed post fields

Posted by Rik Wasmus on 12/05/07 15:59

On Wed, 05 Dec 2007 16:45:46 +0100, gentleJuggernaut <url84t@gmail.com> =
=

wrote:

> 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 =3D curl_init ();
> $fp =3D @fopen('out.txt','w');
> $postdata =3D 'serviceRequest=3D' . $xml;

Hmmz, shouldn't you 'double encode' the data in the $xml here? Once some=
=

possible values/attributes in the XML itself, once the whole lot to make=
=

it postdata? (just guessing here, might work though). So, something like=
=

$postdata =3D 'serviceRequest=3D' . rawurlencode($xml);

> 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.
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация