title: file_get_contents failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden php
body: <p>"Sometime" I get Error</p>
  
  <blockquote>
    <p>file_get_contents(<a href="https://www.googleapis.com/books/v1/volumes?q=xxxxxx" rel="nofollow noreferrer">https://www.googleapis.com/books/v1/volumes?q=xxxxxx</a>):
    failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden</p>
  </blockquote>
  
  <p>my php</p>
  
  <pre><code>&lt;?php
  
  header("Access-Control-Allow-Origin: *"); 
  header('Access-Control-Allow-Headers: X-Requested-With');
  header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
  
      $postdata = file_get_contents("php://input");
      //isset($postdata) {
          //$request = ($postdata);
  
          $isbn = $_GET['isbn'];
  
  
  
         $path = "https://www.googleapis.com/books/v1/volumes?q=isbn:".$isbn."";
  
          $jsondata = file_get_contents($path);
              $jsons = json_decode($jsondata,true);
  
              echo json_encode($jsons);
  
  
  ?&gt;
  </code></pre>