Need help with cURL and POSTing in PHP
- by alex
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?