0
web-api posted
read header http status of CURL result
want to read header what i got from CURL
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, $url );
curl_setopt( $curl, CURLOPT_HTTPHEADER, $headers );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $curl, CURLOPT_VERBOSE , 1 );
curl_setopt( $curl , CURLOPT_HEADER, 1 );
curl_setopt( $curl , CURLOPT_HTTPGET, 1 );
curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
$response = curl_exec($curl);
curl_close ($curl);
now i want to read header what come from response web api
above call is working fine i got response in $response . if header status is good than i want to parse the result so
so basically
if($header_status ==200){
// header status is good parse the result
}else {
//genereate the error .
}
for that header status checking i need to grab the header from result of CURL WEB API call