![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | __del__ |
def | close |
def | cleanup |
def | addheader |
def | open |
def | open_unknown |
def | open_unknown_proxy |
def | retrieve |
def | open_http |
def | http_error |
def | http_error_default |
def | open_https |
def | open_file |
def | open_local_file |
def | open_ftp |
def | open_data |
Public Attributes | |
proxies | |
key_file | |
cert_file | |
addheaders | |
tempcache | |
ftpcache | |
type | |
Static Public Attributes | |
string | version = "Python-urllib/%s" |
Class to open URLs. This is a class rather than just a subroutine because we may need more than one set of global protocol-specific options. Note -- this is a base class for those who don't want the automatic handling of errors type 302 (relocated) and 401 (authorization needed).
def google.appengine.dist27.urllib.URLopener.addheader | ( | self, | |
args | |||
) |
Add a header to be used by the HTTP interface only e.g. u.addheader('Accept', 'sound/basic')
def google.appengine.dist27.urllib.URLopener.http_error | ( | self, | |
url, | |||
fp, | |||
errcode, | |||
errmsg, | |||
headers, | |||
data = None |
|||
) |
Handle http errors. Derived class can override this, or provide specific handlers named http_error_DDD where DDD is the 3-digit error code.
def google.appengine.dist27.urllib.URLopener.http_error_default | ( | self, | |
url, | |||
fp, | |||
errcode, | |||
errmsg, | |||
headers | |||
) |
Default error handler: close the connection and raise IOError.
def google.appengine.dist27.urllib.URLopener.open | ( | self, | |
fullurl, | |||
data = None |
|||
) |
Use URLopener().open(file) instead of open(file, 'r').
def google.appengine.dist27.urllib.URLopener.open_data | ( | self, | |
url, | |||
data = None |
|||
) |
Use "data" URL.
def google.appengine.dist27.urllib.URLopener.open_file | ( | self, | |
url | |||
) |
Use local file or FTP depending on form of URL.
def google.appengine.dist27.urllib.URLopener.open_ftp | ( | self, | |
url | |||
) |
Use FTP protocol.
def google.appengine.dist27.urllib.URLopener.open_http | ( | self, | |
url, | |||
data = None |
|||
) |
Use HTTP protocol.
def google.appengine.dist27.urllib.URLopener.open_https | ( | self, | |
url, | |||
data = None |
|||
) |
Use HTTPS protocol.
def google.appengine.dist27.urllib.URLopener.open_local_file | ( | self, | |
url | |||
) |
Use local file.
def google.appengine.dist27.urllib.URLopener.open_unknown | ( | self, | |
fullurl, | |||
data = None |
|||
) |
Overridable interface to open unknown URL type.
def google.appengine.dist27.urllib.URLopener.open_unknown_proxy | ( | self, | |
proxy, | |||
fullurl, | |||
data = None |
|||
) |
Overridable interface to open unknown URL type.
def google.appengine.dist27.urllib.URLopener.retrieve | ( | self, | |
url, | |||
filename = None , |
|||
reporthook = None , |
|||
data = None |
|||
) |
retrieve(url) returns (filename, headers) for a local object or (tempfilename, headers) for a remote object.