I am calling CURL and trying to do a POST request with parameters:
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, Array("Accept: application/json", "Content-Type: application/json"));
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_USERAGENT, "curl 7.23.1 (x86_64-unknown-linux-gnu)");
curl_setopt($curl, CURLOPT_USERPWD, "username:password");
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_URL, "https://www.mydomain.com/route");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "key1=blah1&key2=blah2");
return curl_exec(curl);
The problem, inside the request at http://www.mydomain.com/route I am not seeing any POST parameters passed. I.E.
print_r($_POST);
Array
(
)
Should have key1=blah1 and key2=blah2. Any ideas?