Stay organized with collections Save and categorize content based on your preferences.
URL Fetch
This service allows scripts to access other resources on the web by fetching URLs. A script can use the UrlFetch service to issue HTTP and HTTPS requests and receive responses. The UrlFetch service uses Google's network infrastructure for efficiency and scaling purposes.
Requests made using this service originate from a set pool of IP ranges. You can look up the full list of IP addresses if you need to whitelist or approve these requests.
The default user agent string of UrlFetch service requests is Mozilla/5.0 (compatible; Google-Apps-Script; beanserver; +https://script.google.com; id: SCRIPT_ID)
.
This service requires the https://www.googleapis.com/auth/script.external_request
scope. In most cases Apps Script automatically detects and includes scopes a script needs, but if you are setting your scopes explicitly you must manually add this scope to use UrlFetchApp
.
HTTPResponse
This class allows users to access specific information on HTTP responses. UrlFetchApp
Fetch resources and communicate with other hosts over the Internet. HTTPResponse
Methods Method Return type Brief description getAllHeaders()
Object
Returns an attribute/value map of headers for the HTTP response, with headers that have multiple values returned as arrays. getAs(contentType)
Blob
Return the data inside this object as a blob converted to the specified content type. getBlob()
Blob
Return the data inside this object as a blob. getContent()
Byte[]
Gets the raw binary content of an HTTP response. getContentText()
String
Gets the content of an HTTP response encoded as a string. getContentText(charset)
String
Returns the content of an HTTP response encoded as a string of the given charset. getHeaders()
Object
Returns an attribute/value map of headers for the HTTP response. getResponseCode()
Integer
Get the HTTP status code (200 for OK, etc.) of an HTTP response. UrlFetchApp
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-04 UTC."],[[["The URL Fetch service enables Apps Script to make HTTP and HTTPS requests to access external web resources, leveraging Google's infrastructure."],["Requests originate from a specific range of IP addresses, which can be whitelisted if necessary for security purposes."],["The `https://www.googleapis.com/auth/script.external_request` scope is required and often automatically included, but needs manual addition for explicitly set scopes."],["`UrlFetchApp` class handles the fetching process with methods like `fetch()` and `fetchAll()`, while `HTTPResponse` provides access to response data like headers, content, and status codes."]]],["The UrlFetch service enables scripts to access web resources via HTTP and HTTPS requests, utilizing Google's network infrastructure. Scripts can fetch URLs using `UrlFetchApp` methods like `fetch` and `fetchAll`. IP ranges are provided for whitelisting purposes. The service requires the `https://www.googleapis.com/auth/script.external_request` scope. `HTTPResponse` methods provide ways to extract response data, headers, and status codes. The user agent is `Mozilla/5.0 (compatible; Google-Apps-Script; beanserver)`.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4