Except as otherwise noted,
the content of this page is licensed under a Creative Commons
license, and examples are licensed under
an Apache
license.
Google Code offered in: 中文 - English - Português - Pусский - Español - 日本語
The google.appengine.api.urlfetch package provides the following function:
Fetches a document at the URL given in url, and returns an object containing the details of the response. See Response Objects for details about the return value.
Arguments:
http or https URL. If the URL is invalid, a InvalidURLError is raised.POST or PUT request.GET, POST, HEAD, PUT, and DELETE. These values are constants provided by the package.False and the response data exceeds the maximum allowed response size, a ResponseTooLargeError exception is raised. If True, no exception is raised, and the response's content is truncated to the maximum size, and the response object's content_was_truncated attribute is set to True. The fetch action is synchronous. fetch() will not return until the server responds. A slow remote server may cause your application's own request to time out.
Note: URL fetching cannot authenticate the server of an https request because there is no certificate trust chain. The proxy accepts all certificates, including self-signed certificates.
For security reasons, the following HTTP headers for outbound HTTP requests cannot be modified by the application.
Content-LengthHostRefererUser-AgentVaryViaX-Forwarded-For