title: when CURLOPT_HTTPHEADER need 'Content-Length'
body: <p>I have this code in the client side of my application:</p>
  
  <pre><code>$ch = curl_init($url);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
  curl_setopt($ch, CURLOPT_HTTPHEADER, array( 
      'Content-Type: application/json', 
      'Content-Length:0 ' ) 
      ); 
  $body = curl_exec($ch);
  </code></pre>
  
  <p>while in the server files:</p>
  
  <pre><code>$ch = curl_init($this-&gt;modelAddress);
  $data = array("params"=&gt;array("resource" =&gt; "artist","operation" =&gt; $operation,"params"=&gt;$params));
  $data_string = json_encode($data);
  
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
      'Content-Type: application/json',                                                                                
      'Content-Length: ' . strlen($data_string))                                                                       
  );
  </code></pre>
  
  <p>They are made from 2 different people and I want to ask what is the most correct.<br/>
  When the use of <code>'Content-Length:0'</code> instead of <code>'Content-Length:'.strlen($data_string)</code> is better. </p>
  
  <p>It's only question of POST/GET method?<br/>
  I've  searched explanations of this in the web but I've found nothing</p>