I know that when preforming POST Curl u set the content length using strlen($postdata)
However, when doing GET how can I determine the content length?
This is my code :
curl_setopt($CR, CURLOPT_URL, CLASS::SENDURL.$get);
curl_setopt($CR, CURLOPT_FAILONERROR, true);
curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($CR, CURLOPT_HTTPHEADER,
array('Content-Type: text/xml; charset=utf-8',
//'Content-Length: '.strlen($get),
'Content-Length: 0 ',
//
));
curl_setopt($CR, CURLINFO_HEADER_OUT, true);
Anyone knows how I can do that?
There is usually no entity body (casually called content) in a GET request. You do not appear to be sending any content and can probably omit the calls to set anything content related.