Reputation: 35
Even though I set the content type to text/plain, CURLOP_POSTFIELDS appears to be overwriting it to x-www-form-urlencoded
curl_setopt($ch, CURLOPT_POSTFIELDS, 'username etc..');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"type" => "POST",
"Accept" => "*/*",
"Content-Type:" => "text/plain; charset=utf-8",
"X-AjaxPro-Method" => "Authenticate2",
"Accept-Language" => "en-us,en;q=0.5",
"Accept-Encoding" => "gzip, deflate",
"Connection" => "keep-alive",
Upvotes: 1
Views: 2082
Reputation: 150
You'll have to remove the colon after Content-Type. Otherwise, try this:
$headers = array(
'type: POST',
'Accept: */*',
'Content-type: text/plain; charset=utf-8',
'X-AjaxPro-Method: Authenticate2',
'Accept-Language: en-us,en;q=0.5',
'Accept-Encoding: gzip, deflate',
'Connection: keep-alive'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
Upvotes: 2