'www.mysite.com/mySecretKey1' 重定向到 'www.othersite.com/mySecretKey2'Google AppsScript方法用於獲取重定向的URL?
在G.AppsScript:
var response = UrlFetchApp.fetch("https://www.mysite.com/mySecretKey1");
var headerString = response.getAllHeaders().toSource();
Logger.log(headerString);
//string 'www.othersite.com.my/SecretKey2' is not present in log.
如何將腳本發現它被重定向的URL地址到(即字符串'www.othersite.com/mySecretKey2')?
更新:更一般地,腳本如何從response
發現URL地址?
「響應」中仍然沒有第一頁或第二頁的URL地址。 – user3645994 2014-11-25 05:29:21