title: how to solve not a valid key=value pair (missing equal-sign) in Authorization header error in GAS
body: <p>I've been stuck in getting data with rest api in GAS and I have already put the Auth token on headers but I got error &quot;〜〜〜〜 not a valid key=value pair (missing equal-sign) in Authorization header&quot;. Actually , I've already succeeded　in getting this data in Python but I can not get it  in GAS. I hope anyone gives me advice . Thank you so much.</p>
  <p>I confirmed id_token is correct.</p>
  <p>So my error is caused in var response1 = UrlFetchApp.fetch(data_endpoint, request1);</p>
  <pre><code>GAS
  
  function myFunction() {
    var login_endpoint = &quot;API URL FOR TOKEN&quot;;
    var params0 = {&quot;adminId&quot;: &quot;xxxxxx&quot;,&quot;password&quot;: &quot;xxxxxxxx&quot;};
  
    var request0 = {
      &quot;method&quot;: &quot;post&quot;,
      &quot;payload&quot;: JSON.stringify(params0),
    };
    
    var response0 = UrlFetchApp.fetch(login_endpoint, request0);
    var data = JSON.parse(response0);
    var id_token = data.Result.id_token;
    // Logger.log(id_token);
  
    var params1 = {'adminId': 'xxxxx','pgId': 'xxxxxxxxx','extraColumn': []};
    var data_endpoint = &quot;API URL FOR USER DATA&quot;;
    var request1 = {
      &quot;method&quot;: &quot;get&quot;,
      'contentType': 'application/json',
      &quot;payload&quot;: JSON.stringify(params1),
      &quot;headers&quot;: { 
        &quot;Authorization&quot;:'Bearer '+ id_token,
      },
      muteHttpExceptions : true 
    };
    var response1 = UrlFetchApp.fetch(data_endpoint, request1);
    Logger.log(response1);
  }
  </code></pre>
  <pre><code>Python
  
  param0 = {&quot;adminId&quot;: &quot;xxxxx&quot;,&quot;password&quot;: &quot;xxxxxxx&quot;}
      url0 = &quot;API URL FOR TOKEN&quot;
      response_post = requests.post(url0, json=param0)
      response_data = response_post.json()
      id_token = response_data[&quot;Result&quot;][&quot;id_token&quot;]
      headers = {&quot;Content-Type&quot;:&quot;application/json&quot;, &quot;Authorization&quot;:id_token}
  
      param1 = {'adminId': 'xxxx','pgId': 'xxxxxxx','extraColumn': []}
      url1 = &quot;API URL FOR USER DATA&quot;
      response_get = requests.get(url1, json=param1, headers=headers)
      response_get.encoding = 'UTF-8'
      with open('./test.csv','w') as f:
          f.write(response_get.text)
  </code></pre>