Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
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.
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.
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
. For more information on limits, see the URL Fetch Service overview.If True
, responses that are HTTP redirects are followed, up to 5 consecutive redirects. The response data is from the final location, as if the data were for the requested location. If False
, redirects are not followed, and a redirect response is returned directly to the application, including the header information that describes the redirect.
Warning: Cookies are not handled upon redirection. If cookie handling is needed, set follow_redirects to False
and handle both cookies and redirects manually.