Stay organized with collections Save and categorize content based on your preferences.
google.appengine.api.urlfetch module SummaryURL downloading API.
ContentsFetches the given HTTP URL, blocking until the result is returned.
GET
POST
HEAD
PUT
DELETE
PATCH
To fetch the result, a HTTP/1.1-compliant proxy is used.
Parametersmethod – The constants GET
, POST
, HEAD
, PUT
, DELETE
, or PATCH
or the same HTTP methods as strings.
payload – POST
, PUT
, or PATCH
payload (implies method is not GET
, HEAD
, or DELETE
). This argument is ignored if the method is not POST
, PUT
, or PATCH
.
headers – Dictionary of HTTP headers to send with the request.
allow_truncated – If set to True
, truncates large responses and returns them without raising an error. Otherwise, a ResponseTooLargeError
is raised when a response is truncated.
follow_redirects – If set to True
(the default), redirects are transparently followed, and the response (if less than 5 redirects) contains the final destination’s payload; the response status is 200. You lose, however, the redirect chain information. If set to False
, you see the HTTP response yourself, including the ‘Location’ header, and redirects are not followed.
deadline – Deadline in seconds for the operation.
validate_certificate – If set to True
, requests are not sent to the server unless the certificate is valid, signed by a trusted CA, and the host name matches the certificate. A value of None
indicates that the behavior will be chosen by the underlying urlfetch
implementation.
An object containing following fields:
content: A string that contains the response from the server.
status_code: The HTTP status code that was returned by the server.
headers: The dictionary of headers that was returned by the server.
object
Raisesurlfetch_errors.Error – If an error occurs. See the urlfetch_errors module for more information.
Note:HTTP errors are returned as a part of the return structure. HTTP errors like 404 do not result in an exception.
Creates an RPC object for use with the urlfetch API.
Parametersdeadline – Optional deadline in seconds for the operation; the default is a system-specific deadline (typically 5 seconds).
callback – Optional callable to invoke on completion.
An apiproxy_stub_map.UserRPC
object specialized for this service.
Fetches the given HTTP URL, blocking until the result is returned.
GET
POST
HEAD
PUT
DELETE
PATCH
To fetch the result, a HTTP/1.1-compliant proxy is used.
Parametersmethod – The constants GET
, POST
, HEAD
, PUT
, DELETE
, or PATCH
or the same HTTP methods as strings.
payload – POST
, PUT
, or PATCH
payload (implies method is not GET
, HEAD
, or DELETE
). This argument is ignored if the method is not POST
, PUT
, or PATCH
.
headers – Dictionary of HTTP headers to send with the request.
allow_truncated – If set to True
, truncates large responses and returns them without raising an error. Otherwise, a ResponseTooLargeError
is raised when a response is truncated.
follow_redirects – If set to True
(the default), redirects are transparently followed, and the response (if less than 5 redirects) contains the final destination’s payload; the response status is 200. You lose, however, the redirect chain information. If set to False
, you see the HTTP response yourself, including the ‘Location’ header, and redirects are not followed.
deadline – Deadline in seconds for the operation.
validate_certificate – If set to True
, requests are not sent to the server unless the certificate is valid, signed by a trusted CA, and the host name matches the certificate. A value of None
indicates that the behavior will be chosen by the underlying urlfetch
implementation.
An object containing following fields:
content: A string that contains the response from the server.
status_code: The HTTP status code that was returned by the server.
headers: The dictionary of headers that was returned by the server.
object
Raisesurlfetch_errors.Error – If an error occurs. See the urlfetch_errors module for more information.
Note:HTTP errors are returned as a part of the return structure. HTTP errors like 404 do not result in an exception.
Gets the default value for create_rpc()
’s deadline parameter.
Executes the RPC call to fetch a given HTTP URL.
The first argument is a UserRPC instance. See urlfetch.fetch
for a thorough description of the remaining arguments.
InvalidMethodError – If the requested method is not in _VALID_METHODS
.
ResponseTooLargeError – If the response payload is too large.
InvalidURLError – If there are issues with the content or size of the requested URL
The RPC object that was passed into the function.
Sets the default value for create_rpc()
’s deadline
parameter.
This setting is thread-specific, meaning it that is stored in a thread local. This function doesn’t check the type or range of the value. The default value is None
.
See also: create_rpc()
, fetch()
value – The default value that you want to use for the deadline
parameter of create_rpc()
.
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 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["The `google.appengine.api.urlfetch` module provides an API for downloading content from HTTP URLs, supporting methods like GET, POST, HEAD, PUT, DELETE, and PATCH."],["The primary function, `fetch`, retrieves content from a specified URL and returns an object with the content, status code, and headers."],["The `create_rpc` function creates an RPC object for use with the urlfetch API, allowing for more complex asynchronous URL fetching operations."],["You can customize requests with parameters such as `method`, `payload`, `headers`, `allow_truncated`, `follow_redirects`, `deadline`, and `validate_certificate` to control the behavior of the fetching operation."],["`set_default_fetch_deadline` and `get_default_fetch_deadline` allow you to set and get a time limit for fetching a url, and it is stored on a per-thread basis."]]],[]]
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