Lines Matching +full:basic +full:- +full:ftp
1 :mod:`urllib` --- Open arbitrary resources by URL
21 This module provides a high-level interface for fetching data across the World
23 built-in function :func:`open`, but accepts Universal Resource Locators (URLs)
24 instead of filenames. Some restrictions apply --- it can only open URLs for
29 The `Requests package <http://docs.python-requests.org/>`_
30 is recommended for a higher-level HTTP client interface.
41 High-level interface
42 --------------------
51 went well, a file-like object is returned. This supports the following
60 these methods have the same interface as for file objects --- see section
61 :ref:`bltin-file-objects` in this manual. (It is not a built-in file object,
62 however, so it can't be used at those few places where a true built-in file
68 :class:`mimetools.Message` containing meta-information associated with the
70 at the head of the retrieved HTML page (including Content-Length and
71 Content-Type). When the method is FTP, a Content-Length header will be
73 to the FTP retrieval request. A Content-Type header will be present if the
74 MIME type can be guessed. When the method is local-file, returned headers
75 will include a Date representing the file's last-modified time, a
76 Content-Length giving file size, and a Content-Type containing a guess at the
91 :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
106 shouldn't be reached via proxy; if set, it should be a comma-separated list
131 # Use proxies from environment - both versions are equivalent
173 third argument may be ``-1`` on older FTP servers which do not return a file
179 :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
185 size reported by a *Content-Length* header). This can occur, for example, when
188 The *Content-Length* is treated as a lower bound: if there's more data to read,
195 If no *Content-Length* header was supplied, :func:`urlretrieve` can not check
208 :mailheader:`User-Agent` header than :class:`URLopener` defines. This can be
226 -----------------
231 digits, and the characters ``'_.-'`` are never quoted. By default, this
234 --- its default value is ``'/'``.
249 Replace ``%xx`` escapes by their single-character equivalent.
262 Convert a mapping object or a sequence of two-element tuples to a
263 "percent-encoded" string, suitable to pass to :func:`urlopen` above as the
268 two-element tuples is used as the *query* argument, the first element of
288 Convert the path component *path* from a percent-encoded URL to the local syntax for a
322 ------------------
327 objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:`,
330 By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` header
332 Applications can define their own :mailheader:`User-Agent` header by subclassing
373 local file, the input filename is returned. If the URL is non-local and
383 :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
400 the actual URL. For 401 response codes (authentication required), basic HTTP
418 When performing basic authentication, a :class:`FancyURLopener` instance calls
430 password)``, which can be used for basic authentication.
440 *Content-Length* header). The :attr:`content` attribute stores the downloaded
447 --------------------------
451 pair: FTP; protocol
454 1.0), FTP, and local files.
462 file can't be opened, the URL is re-interpreted using the FTP protocol. This
478 header, which can be inspected by looking at the :mailheader:`Content-Type`
482 .. index:: single: FTP
484 * The code handling the FTP protocol cannot differentiate between a file and a
492 you try to fetch a file whose read permissions make it inaccessible; the FTP
494 listing for the unreadable file. If fine-grained control is needed, consider
508 .. _urllib-examples:
511 --------
518 >>> f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query?%s" % params)
525 >>> f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)