Reply to Re: cURL changes passed post fields

Your name:

Reply:


Posted by gentleJuggernaut on 12/05/07 16:06

On Dec 5, 10:59 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Wed, 05 Dec 2007 16:45:46 +0100, gentleJuggernaut <url...@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 = curl_init ();
> > $fp = @fopen('out.txt','w');
> > $postdata = 'serviceRequest=' . $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 = 'serviceRequest=' . 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


Thank you Rik, that is exactly what I needed. I am somewhat new to
passing data to webservices, I am going to look up the rawurlencode()
function, is there any other information that you could point me to?

Thanks again.

NSM

[Back to original 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

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