Mercurial > cpython-lru_cache-weakref
comparison Doc/library/simplehttpserver.rst @ 46581:3d9ddce2da85 legacy-trunk
minor wording changes, rewrap a few lines
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Sun, 27 Apr 2008 20:53:57 +0000 |
| parents | 66c8bd1bedf3 |
| children | 662d15af52df |
comparison
equal
deleted
inserted
replaced
| 46580:06aa802bfcb1 | 46581:3d9ddce2da85 |
|---|---|
| 5 .. module:: SimpleHTTPServer | 5 .. module:: SimpleHTTPServer |
| 6 :synopsis: This module provides a basic request handler for HTTP servers. | 6 :synopsis: This module provides a basic request handler for HTTP servers. |
| 7 .. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il> | 7 .. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il> |
| 8 | 8 |
| 9 | 9 |
| 10 The :mod:`SimpleHTTPServer` module defines a request-handler class, | 10 The :mod:`SimpleHTTPServer` module defines a single class, |
| 11 interface-compatible with :class:`BaseHTTPServer.BaseHTTPRequestHandler`, that | 11 :class:`SimpleHTTPRequestHandler`, which is interface-compatible with |
| 12 serves files only from a base directory. | 12 :class:`BaseHTTPServer.BaseHTTPRequestHandler`. |
| 13 | 13 |
| 14 The :mod:`SimpleHTTPServer` module defines the following class: | 14 The :mod:`SimpleHTTPServer` module defines the following class: |
| 15 | 15 |
| 16 | 16 |
| 17 .. class:: SimpleHTTPRequestHandler(request, client_address, server) | 17 .. class:: SimpleHTTPRequestHandler(request, client_address, server) |
| 18 | 18 |
| 19 This class is used to serve files from the current directory and below, directly | 19 This class serves files from the current directory and below, directly |
| 20 mapping the directory structure to HTTP requests. | 20 mapping the directory structure to HTTP requests. |
| 21 | 21 |
| 22 A lot of the work, such as parsing the request, is done by the base class | 22 A lot of the work, such as parsing the request, is done by the base class |
| 23 :class:`BaseHTTPServer.BaseHTTPRequestHandler`. This class implements the | 23 :class:`BaseHTTPServer.BaseHTTPRequestHandler`. This class implements the |
| 24 :func:`do_GET` and :func:`do_HEAD` functions. | 24 :func:`do_GET` and :func:`do_HEAD` functions. |
| 25 | 25 |
| 26 The :class:`SimpleHTTPRequestHandler` defines the following member variables: | 26 The following are defined as class-level attributes of |
| 27 :class:`SimpleHTTPRequestHandler`: | |
| 27 | 28 |
| 28 | 29 |
| 29 .. attribute:: server_version | 30 .. attribute:: server_version |
| 30 | 31 |
| 31 This will be ``"SimpleHTTP/" + __version__``, where ``__version__`` is | 32 This will be ``"SimpleHTTP/" + __version__``, where ``__version__`` is |
| 32 defined in the module. | 33 defined at the module level. |
| 33 | 34 |
| 34 | 35 |
| 35 .. attribute:: extensions_map | 36 .. attribute:: extensions_map |
| 36 | 37 |
| 37 A dictionary mapping suffixes into MIME types. The default is signified by | 38 A dictionary mapping suffixes into MIME types. The default is |
| 38 an empty string, and is considered to be ``application/octet-stream``. The | 39 signified by an empty string, and is considered to be |
| 39 mapping is used case-insensitively, and so should contain only lower-cased | 40 ``application/octet-stream``. The mapping is used case-insensitively, |
| 40 keys. | 41 and so should contain only lower-cased keys. |
| 41 | 42 |
| 42 The :class:`SimpleHTTPRequestHandler` defines the following methods: | 43 The :class:`SimpleHTTPRequestHandler` class defines the following methods: |
| 43 | 44 |
| 44 | 45 |
| 45 .. method:: do_HEAD() | 46 .. method:: do_HEAD() |
| 46 | 47 |
| 47 This method serves the ``'HEAD'`` request type: it sends the headers it | 48 This method serves the ``'HEAD'`` request type: it sends the headers it |
