title: Is there any way to change User-Agent of Apps script?
body: <p>I am trying to change <code>User-Agent</code>. But It seems like I can't change it.</p>
  
  <p>I implemented like this:</p>
  
  <pre><code>{
  'User-Agent': "my spreadsheet" 
  }
  </code></pre>
  
  <p>the value above passes API function like this:</p>
  
  <pre><code>function API(m_headers, method, data){
    var options = {
      'headers': m_headers,
      'muteHttpExceptions' : false,
      'method' : method,
      'payload' : data
    };
  
    var url = base_url+api;
    try{
      var response = UrlFetchApp.fetch(url, options)
    }catch(e){
        return url+"\n"+JSON.stringify(e);
    }
  }
  </code></pre>
  
  <p>And I get <code>Attribute provided with invalid value in Google Apps Script</code> error.</p>
  
  <pre><code>{"message":"Attribute provided with invalid value: headers","name":"Exception","fileName":"Code","lineNumber":42,"stack":"\tat Code:42 (API)\n"}
  </code></pre>
  
  <p>How can I solve this?</p>