Need help with cURL and POSTing in PHP

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-06-04T05:53:42Z Indexed on 2010/06/04 6:19 UTC
Read the original article Hit count: 190

Filed under:
|
|

I need to post to a payment gateway. The example PHP script for the gateway simply sets the XML like this

curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest); // $xmlRequest is just a string of XML

In all of my experience, generally you need to use an array with key/values or a string similar to GET params.

I am using Kohana, and tracked down a cURL module. It accepts the POST key/values as an array only.

Now, I could ditch the module and throw some cURL straight in, but I am using this module fine all throughout the site, so would prefer to use it here.

So, my question is, how does that first one work? Does it just POST the whole thing without any named key? Is there a default key I could use for an array to get the module to work?

© Stack Overflow or respective owner

Related posts about php

Related posts about post