Questions tagged [urlfetch]

Use in addition to tags Google App Engine / Google Apps Script. Urlfetch is a built-in library that is used to fetch external URLs. Unlike other data fetching modules/libraries, data is fetched synchronously blocking until the result is returned.

Urlfetch is a built-in library that is used in Google products such as Google Apps Script or Google App Engine to fetch external URLs. Unlike other data fetching modules/libraries, data is fetched synchronously blocking until the result is returned.


Useful links

  1. UrlFetchApp class reference;
  2. HTTPResponse class reference;
  3. OAuthConfig class migration reference;
  4. Request origin pool of IP addresses;
  5. urlfetch module for Python 2 App Engine API reference.

Related tags

826 questions
72
votes
5 answers

A very simple multithreading parallel URL fetching (without queue)

I spent a whole day looking for the simplest possible multithreaded URL fetcher in Python, but most scripts I found are using queues or multiprocessing or complex libraries. Finally I wrote one myself, which I am reporting as an answer. Please feel…
Daniele B
  • 19,801
  • 29
  • 115
  • 173
64
votes
2 answers

Invalid and/or missing SSL certificate when using Google App Engine

UPDATE: Please, if anyone can help: Google is waiting for inputs and examples of this problem on their bug tracking tool. If you have reproducible steps for this issue, please share them on:…
Romain
  • 3,718
  • 3
  • 32
  • 48
47
votes
2 answers

How to use UrlFetchApp with credentials? Google Scripts

I am trying to use Google Scripts UrlFetchApp to access a website with a basic username and password. As soon as I connect to the site a popup appears that requires authentication. I know the Login and Password, however I do not know how to pass…
29
votes
4 answers

Anonymous caller does not have storage.objects.get

On Google App Engine (GAE) written in Python. I am trying to issue an http post to cloud-speech-to-text api and using URI audio source (Google Cloud Storage Bucket Objects). I am using the following headers; Authorization: BASIC…
27
votes
4 answers

How to catch UrlFetchApp.fetch exception

Is there any way to catch the exception from UrlFetchApp.fetch? I thought I can use response.getResponseCode() to check the response code, but I'm not able to, for e.g when there is 404 error, the script not continue and just stop at…
louis
  • 353
  • 1
  • 3
  • 8
22
votes
2 answers

How can I see the full server response for this API error message in Google Scripts?

I'm getting an error response from the API that I'm using, but Google scripts seems to truncate the message. How can I see the full message in Google scripts? This is the message: Request failed for https://api.myintervals.com/task/ returned code…
Takeshi Patterson
  • 1,207
  • 6
  • 15
  • 29
21
votes
4 answers

Loading a custom key store in Google App Engine Java application

I want to open a HTTPS connection in a Google App Engine app using the URLFetch service. To be able to verify the SSL certificate of the server my app is talking to, I am using my own keystore file. I want to read this file in a warmup request when…
Ingo
  • 1,552
  • 10
  • 31
21
votes
2 answers

Google apps script urlfetch encoding URL

I would like to use urlfetch to populate a spreadsheet with page data but the URL that I am trying to use is coming back with an error as an invalid argument. I think the problem is that I am using characters in the URL that are being misinterpreted…
Pigcowpig
  • 211
  • 1
  • 2
  • 4
20
votes
5 answers

How to send a JSON payload with UrlFetchApp service?

I'm trying to POST to a web service that is expecting to get JSON as payload using Google Apps Script. I'm using the following code: var options = { "method" : "post", "contentType" : "application/json", "headers" : { "Authorization" :…
Guy
  • 12,388
  • 3
  • 45
  • 67
20
votes
2 answers

Cookie handling in Google Apps Script - How to send cookies in header?

I'm trying to write a simple script that fetches text from a webpage and processes that string. But, that website requires me to be logged in. I was successful in logging in to that website. This is how I logged in: var payload =…
akarthik10
  • 322
  • 1
  • 4
  • 11
18
votes
5 answers

GAE - AppEngine - DeadlineExceededError: Deadline exceeded while waiting for HTTP response from URL:

I have a Google AppEngine application which runs great on my local machine. The app posts a image (from a url) to my facebook wall. However, when I deploy it to Google's servers, I get an error: DeadlineExceededError: Deadline exceeded while…
Brett
  • 11,637
  • 34
  • 127
  • 213
16
votes
2 answers

Some methods/functions simply do not work in onEdit trigger

I'm looking to call UrlFetchApp.fetch() based on user input on a sheet but nothing happens. No errors, just silently ignores the call. Same goes for MailApp.sendEmail() and GmailApp.sendEmail() This is on a Google Apps domain, and only domain users…
13
votes
1 answer

Python GAE urlfetch credentials

I'd like to know if the Google App Engine URL Fetch Python API does not support accessing URLs that have credentials: http://username:password@www.domain.com/ It should be a basic feature, but I cannot get it to work and could not find any…
raugfer
  • 1,844
  • 19
  • 19
11
votes
4 answers

Unexpected error on UrlFetchApp.fetch in Google Apps Script using basic authentication

I have the following code in Google Apps Script which retrieves CSV data from a webpage via HTTP using basic authentication and places it into a spreadsheet: CSVImport.gs function parseCSVtoSheet(sheetName, url) { // Credentials var username =…
Step
  • 463
  • 1
  • 4
  • 19
11
votes
4 answers

What happens if an application calls more than 10 asynchronous URL Fetch on Google App Engine?

Reading the Google App Engine documentation on asynchronous URL Fetch: The app can have up to 10 simultaneous asynchronous URL Fetch calls What happens if an application calls more than 10 async fetch at a time? Does Google App Engine raise an…
systempuntoout
  • 71,966
  • 47
  • 171
  • 241
1
2 3
55 56