I have written a class that detects if cURL is available, if it is performs GET, POST, DELETE using cURL. In the cURL version I use curl_getinfo($curl, CURLINFO_HTTP_CO
curl_getinfo($curl, CURLINFO_HTTP_CO
Use get_headers:
Edit: get_headers requires an additional call, and is not appropriate for this scenario. Use $http_response_headers as suggested by hakre.
get_headers
$http_response_headers