title: PHP CURL returning 301 Location
body: <p>My curl php code is returning 301 and i can't print out what the curl returned. 
  this is my code: </p>
  
  <pre><code>$ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, "https://subdomain.thinkific.com/api/public/v1/users/3418346");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($ch, CURLOPT_HEADER, FALSE);
  
  $headers = array();
  $headers[] = "X-Auth-Api-Key: myapikey";
  $headers[] = "X-Auth-Subdomain: subdomain";
  $headers[] = "Content-Type: application/json";
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  
  
  $result = curl_exec($ch);
  if (curl_errno($ch)) {
      echo 'Error:' . curl_error($ch);
  }
  curl_close($ch);
  var_dump($result);
  </code></pre>
  
  <p>Here is what it returned: </p>
  
  <pre><code>string(142) "301{"Location"=&gt;"https:subdomain.thinkific.com/api/public/v1/users/3418346", "Cache-Control"=&gt;"no-cache"}#" 
  </code></pre>
  
  <p>i have tried json_decode the result to print it, still the same. as well as i also tried those: </p>
  
  <pre><code>curl_setopt($ch, CURLOPT_ENCODING, "");
  curl_setopt($ch, CURLOPT_AUTOREFERER, true);
  curl_setopt($ch, CURLOPT_NOBODY, 1); //this one returned string(0) without 301
  </code></pre>
  
  <p>I need to know if the error is from my server or it has something to do with my code. ( i did not share api key and subdomain for privacy sorry).</p>