This does not get gzipped content, but plain content. How to make file_get_contents send headers with https ?
$url = 'https://www.google.co.in/';
///Try to fetch compressed content using the file_get_contents function
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en-US,en;q=0.8
" .
"Accept-Encoding: gzip,deflate,sdch
" .
"Accept-Charset:UTF-8,*;q=0.5
"
)
);
$context = stream_context_create($opts);
$zipped_content = file_get_contents($url ,false,$context);
echo $zipped_content;
print_r($http_response_header);
If the url is http://www.yahoo.co.in then the gzipped content is served (and to confirm, it appears like rubbish).
But when using "https://" it seems that file_get_contents does not send the headers specified.