Lines Matching +full:basic +full:- +full:ftp
5 below). It opens the URL and returns the results as file-like
13 non-error returns. The HTTPRedirectHandler automatically deals with
17 urlopen(url, data=None) -- Basic usage is the same as original
19 get a file-like object back. One difference is that you can also pass
24 build_opener -- Function that creates a new OpenerDirector instance.
30 install_opener -- Installs a new opener as the default opener.
34 OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
37 Request -- An object that encapsulates the state of a request. The
39 headers, e.g. a User-Agent.
41 BaseHandler --
44 URLError -- A subclass of IOError, individual protocols have their own
47 HTTPError -- Also a valid HTTP response, so you can treat an HTTP error
61 uri='https://mahler:8092/site-updates.py',
65 proxy_support = urllib2.ProxyHandler({"http" : "http://ahad-haam:3128"})
67 # build a new opener that adds authentication and caching FTP handlers
85 # ftp errors aren't handled cleanly
86 # check digest against correct (i.e. non-apache) implementation
127 # used in User-Agent header sent
165 # URLError is a sub-type of IOError, but it doesn't share any of
178 """Raised when HTTP error occurs, but also acts like non-error return"""
209 """Return request-host, as defined by RFC 2965.
228 # unwrap('<URL:type://host/path>') --> 'type://host/path'
248 # methods getting called in a non-standard order. this may be
338 client_version = "Python-urllib/%s" % __version__
339 self.addheaders = [('User-agent', client_version)]
423 # pre-process request
431 # post-process response
456 # XXX http[s] protocols are special-cased
483 for HTTP, FTP and when applicable, HTTPS.
572 perform the redirect. Otherwise, raise HTTPError if no-one
587 if k.lower() not in ("content-length", "content-type")
598 # have already seen. Do this by adding a handler-specific
620 # other than HTTP, HTTPS or FTP.
624 newurl_lower.startswith('ftp://')):
626 msg + " - Redirection to url '%s' is not allowed" %
632 # handlers that also use handler-specific request attributes
670 >>> _parse_proxy('file:/ftp.example.com/')
672 ValueError: proxy URL with no authority: 'file:/ftp.example.com/'
704 >>> _parse_proxy('ftp://joe:password@proxy.example.com/rubbish:3128')
705 ('ftp', 'joe', 'password', 'proxy.example.com')
722 # We have an authority, so for RFC 3986-compliant URLs (by ss 3.
725 if end == -1:
762 req.add_header('Proxy-authorization', 'Basic ' + creds)
773 # {'http': 'ftp://proxy.example.com'}, we may end up turning
775 # ftp://proxy.example.com/a
854 # XXX this allows for multiple auth-schemes, but will stupidly pick
857 # allow for double- and single-quoted realm values
862 # XXX could pre-emptively send auth info already accepted (RFC 2617,
884 warnings.warn("Basic Auth Realm was unquoted",
886 if scheme.lower() == 'basic':
893 auth = 'Basic %s' % base64.b64encode(raw).strip()
908 response = self.http_error_auth_reqed('www-authenticate',
915 auth_header = 'Proxy-authorization'
923 response = self.http_error_auth_reqed('proxy-authenticate',
932 # other platform-specific mechanisms for getting random bytes.
945 # XXX The client does not inspect the Authentication-Info header
951 # XXX qop="auth-int" supports is shaky
968 # Don't fail endlessly - if we failed once, we'll probably
995 # The cnonce-value is an opaque
1048 # XXX handle auth-int.
1066 # algorithm should be case-insensitive according to RFC2617
1073 # XXX MD5-sess
1088 Digest authentication improves on basic authentication because it
1093 handler_order = 490 # before Basic auth
1097 retry = self.http_error_auth_reqed('www-authenticate',
1105 auth_header = 'Proxy-Authorization'
1106 handler_order = 490 # before Basic auth
1110 retry = self.http_error_auth_reqed('proxy-authenticate',
1130 if not request.has_header('Content-type'):
1132 'Content-type',
1133 'application/x-www-form-urlencoded')
1134 if not request.has_header('Content-length'):
1136 'Content-length', '%d' % len(data))
1156 The addinfourl return value is a file-like object. It also
1158 - info(): return a mimetools.Message object for the headers
1159 - geturl(): return the original request URL
1160 - code: HTTP status code
1186 proxy_auth_hdr = "Proxy-Authorization"
1189 # Proxy-Authorization should not be sent to origin
1273 if v[0] == '"' and v[-1] == '"':
1274 v = v[1:-1]
1281 In particular, parse comma-separated lists where the elements of
1282 the list may include quoted-strings. A quoted-string could
1283 contain a comma. A non-quoted string could have quotes in the
1285 Only double-quotes count, not single-quotes.
1328 # Use local file or FTP depending on form of URL
1333 req.type = 'ftp'
1363 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
1385 raise URLError('ftp error: no host given')
1409 dirs, file = dirs[:-1], dirs[-1]
1424 headers += "Content-type: %s\n" % mtype
1426 headers += "Content-length: %d\n" % retrlen
1431 raise URLError, ('ftp error: %s' % msg), sys.exc_info()[2]
1436 ## fw.ftp.set_debuglevel(1)