Open buttflattery opened 6 years ago
i could not find any source of setting the Content-Type headers for the curl call against the postMessage() function, previously i used to post messages using native curl like below with json data for curl POSTFIELDS option
Content-Type
postMessage()
json
POSTFIELDS
$data = array( 'messages' => array( array( 'body' => array( 'lead'=>1245121542124 ), 'delay' => intval($delay), ), ), ); $url = 'https://mq-kv-aws-us-east-1-1.iron.io/3/projects/' . $projectKey . '/queues/' . $queue . '/messages'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Authorization: OAuth ' . $this->token, 'Content-Length: ' . strlen($data)) ); $result = curl_exec($ch); curl_close($ch);
But i couldnt find any option to specify the Content-Type : application/json when sending data to the postMessage
Content-Type : application/json
postMessage
i could not find any source of setting the
Content-Type
headers for the curl call against thepostMessage()
function, previously i used to post messages using native curl like below withjson
data for curlPOSTFIELDS
optionBut i couldnt find any option to specify the
Content-Type : application/json
when sending data to thepostMessage