function _linkedin_http_request in LinkedIn Integration 7
Same name and namespace in other branches
- 6 linkedin.inc \_linkedin_http_request()
3 calls to _linkedin_http_request()
- linkedin_access_token in ./
linkedin.inc - @todo Please document this function.
- _linkedin_get_fields in ./
linkedin.inc - @todo Please document this function.
- _linkedin_put_profile_field in ./
linkedin.inc - @todo Please document this function.
File
- ./
linkedin.inc, line 333
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;
}