Take a cURL handle:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "example.com");
// Add request headers to curl_getinfo()
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
// Enable compression (usually gzip)
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_exec($ch);
Now I would like to reuse this cURL handle to make another request. (I think that is common and recommended.)
But I want this second request to be made without an Accept-Encoding
header. How can I undo the effect of curl_setopt($ch, CURLOPT_ENCODING, '')
?
I tried setting it to null
and false
but they had no effect.