I am trying to use jobcrank feeds api and it requires data to be sent in headers I want to make request in the following format
POST /v2/QueryService.asmx/QueryJob HTTP/1.1
Host: api.jobcrank.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
and the query parameters will be sent in following method
apiKey=string&apiSerial=string&serviceTypeID=string&jobType=string&keyWordsType=string&keyWords=string&stateAbbreviation=string&county=string&city=string&isWorkFromHome=string
I have written code also for this but dont know how to send header containing "POST /v2/QueryService.asmx/QueryJob HTTP/1.1" line Here is my code:`
<?php
$fields = array(
'apiKey'=>'XXX',
'apiSerial'=>'XXXX',);
$fields_string="";
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'/v2/QueryService.asmx/QueryJob');
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
$result = curl_exec($ch);
print $result;
?>