Trying to grab data from a website using Google Apps Script to put it directly into a spreadsheet. The fetch does not seem to be working, where the Python requests equivalent works just fine.
Python code:
page = requests.get("someurl?as_data_structure", headers={'user-agent':'testagent'})
GAS code:
var page = UrlFetchApp.fetch("someurl?as_data_structure", headers={'user-agent':'testagent'});
The only required header is the user-agent, and the error I am getting from the GAS code is what I would usually get from the Python code if I hadn't included the header. I am new to js but as far as I know this is the proper way to do it..?
EDIT: Now got the headers in the right place but the issue persists, exactly the same error as before.
var options = {"headers": {"User-Agent": "testagent"}};
var page = UrlFetchApp.fetch("someurl?as_data_structure", options);