title: Google App Script external API return error 406
body: <p>I'm trying to fetch a URL using optional advanced parameters in GAS:     </p>
  
  <pre><code>function myFunction() {
    var options = {};
    options = {
      headers: {
        Authorization: 'Bearer ?????',
        'Content-Type': 'application/json',
      },
    };
    UrlFetchApp.fetch(&lt;url&gt;, options);
  }
  </code></pre>
  
  <p>I always get:</p>
  
  <blockquote>
    <p>Request failed for  returned code 406 (line 52, file "Project").    </p>
  </blockquote>
  
  <p>HTTPResponse:    </p>
  
  <blockquote>
    <p>SyntaxError: Empty JSON string    </p>
  </blockquote>
  
  <p>I did the same fetching in Excel Power Query:</p>
  
  <pre><code>let
      Source = Json.Document(Web.Contents(&lt;URL&gt;, [Headers=[Authorization="Bearer 
  ?????????????", ContentType="application/json"]])),
  </code></pre>
  
  <p>And it works, it works also using Postman...</p>
  
  <p>What's the problem with GAS? Please help me! Thanks in advance to everybody.
  Andrea</p>