In quite a few curl examples people use:
curl_setopt($ch, CURLOPT_HEADER, 0);
What is the benefit of doing this?
I managed to display an image and I want to know what options I should put on/off and why.
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); // use?
curl_setopt($curlGetToken, CURLOPT_ENCODING, 'gzip'); // does it slow down MY server
When CURLOPT_HEADER is set to 0 the only effect is that header info from the response is excluded from the output. So if you don't need it that's a few less KBs that curl will return to you.
As per the docs, it controls whether the response header(s) will be returned alongside the response body. Generally, if you only care about the response body, you want this disabled (which is the default value, 0
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With