title: Dropbox API Token Verification
body: <p>This question follows on from my <a href="https://stackoverflow.com/questions/34226309/dropbox-api-token-format">previous one</a>. I thought I would perform a basic token authentication by calling the <a href="https://www.dropbox.com/developers/documentation/http/documentation#users-get_space_usage" rel="nofollow noreferrer">get_space_usage</a> API function.  I tried</p>
  
  <pre><code> $headers = array("Authorization: Bearer  token",
                   "Content-Type:application/json");
   $ch = curl_init('https://api.dropboxapi.com/2/users/get_space_usage/');
   curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
   curl_setopt($ch,CURLOPT_POST,true);
   curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
   $response = curl_exec($ch);
  
   curl_close($ch);
   echo $response;
  </code></pre>
  
  <p>The documentation does not in fact indicate that it is necessary to provide a <em>Content-Type</em> header.  However, without that header I get the message</p>
  
  <blockquote>
    <p>Bad HTTP "Content-Type" header: "application/x-www-form-urlencoded". Expecting one of "application/json",...</p>
  </blockquote>
  
  <p>Putting in that header but supplying no POST fields produces another error</p>
  
  <blockquote>
    <p>request body: could not decode input as JSON</p>
  </blockquote>
  
  <p>Just providing some dummy post data <code>curl_setopt($ch,CURL_POSTFIELDS,json_encode(array('a'=&gt;1)));</code> does not do anything to remedy the situation.  What am I doing wrong?</p>