function _linkedin_http_request in LinkedIn Integration 6
Same name and namespace in other branches
- 7 linkedin.inc \_linkedin_http_request()
3 calls to _linkedin_http_request()
File
- ./
linkedin.inc, line 297
Code
function _linkedin_http_request($url, $header, $body = NULL) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
$header,
));
curl_setopt($ch, CURLOPT_URL, $url);
if ($body) {
curl_setopt($ch, CURLOPT_POST, 1);
if ($body == 'token_request') {
curl_setopt($ch, CURLOPT_POSTFIELDS, '');
}
else {
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
$header,
'Content-Type: text/xml;charset=utf-8',
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
}
}
$output = curl_exec($ch);
curl_close($ch);
return $output;
}