title: failed to open stream: HTTP request failed! HTTP/1.1 422 Unprocessable Entity
body: <p>I am trying to connect to the Envato api, but every so often i get the following error:</p>
  
  <p><strong>failed to open stream: HTTP request failed! HTTP/1.1 422 Unprocessable Entity</strong></p>
  
  <p>Here is my code</p>
  
  <pre><code>$codecanyon_url = file_get_contents("http://marketplace.envato.com/api/edge/categories:codecanyon.json");
  $codecanyon_decode = json_decode($codecanyon_url, true);
  
  foreach($codecanyon_decode['categories'] as $x=&gt; $item) {
          echo $item['name'].' - '. $item['path'];
          echo "&lt;br&gt;";
      }
  </code></pre>
  
  <p>Does anyone see anything wrong with this? It happens intermittently. I have tried to <code>urlencode</code> the url but this make no difference.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks,
  Dan </p>