Mercurial > cpython-lru_cache-weakref
annotate Doc/library/basehttpserver.rst @ 47310:662d15af52df legacy-trunk
Add renaming notices to 3.0 http package members.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Mon, 26 May 2008 15:01:48 +0000 |
| parents | ba1fa511b72d |
| children | 30834b9aa193 |
| rev | line source |
|---|---|
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
1 :mod:`BaseHTTPServer` --- Basic HTTP server |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
2 =========================================== |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
3 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
4 .. module:: BaseHTTPServer |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
5 :synopsis: Basic HTTP server (base class for SimpleHTTPServer and CGIHTTPServer). |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
6 |
|
47310
662d15af52df
Add renaming notices to 3.0 http package members.
Georg Brandl <georg@python.org>
parents:
47241
diff
changeset
|
7 .. note:: |
|
662d15af52df
Add renaming notices to 3.0 http package members.
Georg Brandl <georg@python.org>
parents:
47241
diff
changeset
|
8 The :mod:`BaseHTTPServer` module has been merged into :mod:`http.server` in |
|
662d15af52df
Add renaming notices to 3.0 http package members.
Georg Brandl <georg@python.org>
parents:
47241
diff
changeset
|
9 Python 3.0. The :term:`2to3` tool will automatically adapt imports when |
|
662d15af52df
Add renaming notices to 3.0 http package members.
Georg Brandl <georg@python.org>
parents:
47241
diff
changeset
|
10 converting your sources to 3.0. |
|
662d15af52df
Add renaming notices to 3.0 http package members.
Georg Brandl <georg@python.org>
parents:
47241
diff
changeset
|
11 |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
12 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
13 .. index:: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
14 pair: WWW; server |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
15 pair: HTTP; protocol |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
16 single: URL |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
17 single: httpd |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
18 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
19 .. index:: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
20 module: SimpleHTTPServer |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
21 module: CGIHTTPServer |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
22 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
23 This module defines two classes for implementing HTTP servers (Web servers). |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
24 Usually, this module isn't used directly, but is used as a basis for building |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
25 functioning Web servers. See the :mod:`SimpleHTTPServer` and |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
26 :mod:`CGIHTTPServer` modules. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
27 |
|
47241
ba1fa511b72d
socketserver renaming reversal part 3: move the module into the right
Georg Brandl <georg@python.org>
parents:
46929
diff
changeset
|
28 The first class, :class:`HTTPServer`, is a :class:`SocketServer.TCPServer` |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
29 subclass. It creates and listens at the HTTP socket, dispatching the requests |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
30 to a handler. Code to create and run the server looks like this:: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
31 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
32 def run(server_class=BaseHTTPServer.HTTPServer, |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
33 handler_class=BaseHTTPServer.BaseHTTPRequestHandler): |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
34 server_address = ('', 8000) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
35 httpd = server_class(server_address, handler_class) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
36 httpd.serve_forever() |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
37 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
38 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
39 .. class:: HTTPServer(server_address, RequestHandlerClass) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
40 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
41 This class builds on the :class:`TCPServer` class by storing the server |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
42 address as instance variables named :attr:`server_name` and |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
43 :attr:`server_port`. The server is accessible by the handler, typically |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
44 through the handler's :attr:`server` instance variable. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
45 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
46 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
47 .. class:: BaseHTTPRequestHandler(request, client_address, server) |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
48 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
49 This class is used to handle the HTTP requests that arrive at the server. By |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
50 itself, it cannot respond to any actual HTTP requests; it must be subclassed |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
51 to handle each request method (e.g. GET or |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
52 POST). :class:`BaseHTTPRequestHandler` provides a number of class and |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
53 instance variables, and methods for use by subclasses. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
54 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
55 The handler will parse the request and the headers, then call a method |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
56 specific to the request type. The method name is constructed from the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
57 request. For example, for the request method ``SPAM``, the :meth:`do_SPAM` |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
58 method will be called with no arguments. All of the relevant information is |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
59 stored in instance variables of the handler. Subclasses should not need to |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
60 override or extend the :meth:`__init__` method. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
61 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
62 :class:`BaseHTTPRequestHandler` has the following instance variables: |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
63 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
64 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
65 .. attribute:: client_address |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
66 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
67 Contains a tuple of the form ``(host, port)`` referring to the client's |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
68 address. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
69 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
70 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
71 .. attribute:: command |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
72 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
73 Contains the command (request type). For example, ``'GET'``. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
74 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
75 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
76 .. attribute:: path |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
77 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
78 Contains the request path. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
79 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
80 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
81 .. attribute:: request_version |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
82 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
83 Contains the version string from the request. For example, ``'HTTP/1.0'``. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
84 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
85 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
86 .. attribute:: headers |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
87 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
88 Holds an instance of the class specified by the :attr:`MessageClass` class |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
89 variable. This instance parses and manages the headers in the HTTP |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
90 request. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
91 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
92 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
93 .. attribute:: rfile |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
94 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
95 Contains an input stream, positioned at the start of the optional input |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
96 data. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
97 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
98 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
99 .. attribute:: wfile |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
100 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
101 Contains the output stream for writing a response back to the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
102 client. Proper adherence to the HTTP protocol must be used when writing to |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
103 this stream. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
104 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
105 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
106 :class:`BaseHTTPRequestHandler` has the following class variables: |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
107 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
108 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
109 .. attribute:: server_version |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
110 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
111 Specifies the server software version. You may want to override this. The |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
112 format is multiple whitespace-separated strings, where each string is of |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
113 the form name[/version]. For example, ``'BaseHTTP/0.2'``. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
114 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
115 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
116 .. attribute:: sys_version |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
117 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
118 Contains the Python system version, in a form usable by the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
119 :attr:`version_string` method and the :attr:`server_version` class |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
120 variable. For example, ``'Python/1.4'``. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
121 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
122 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
123 .. attribute:: error_message_format |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
124 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
125 Specifies a format string for building an error response to the client. It |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
126 uses parenthesized, keyed format specifiers, so the format operand must be |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
127 a dictionary. The *code* key should be an integer, specifying the numeric |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
128 HTTP error code value. *message* should be a string containing a |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
129 (detailed) error message of what occurred, and *explain* should be an |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
130 explanation of the error code number. Default *message* and *explain* |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
131 values can found in the *responses* class variable. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
132 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
133 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
134 .. attribute:: error_content_type |
|
45449
734fc0a19657
#1492: allow overriding BaseHTTPServer's content type for error messages.
Georg Brandl <georg@python.org>
parents:
42604
diff
changeset
|
135 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
136 Specifies the Content-Type HTTP header of error responses sent to the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
137 client. The default value is ``'text/html'``. |
|
45449
734fc0a19657
#1492: allow overriding BaseHTTPServer's content type for error messages.
Georg Brandl <georg@python.org>
parents:
42604
diff
changeset
|
138 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
139 .. versionadded:: 2.6 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
140 Previously, the content type was always ``'text/html'``. |
|
45449
734fc0a19657
#1492: allow overriding BaseHTTPServer's content type for error messages.
Georg Brandl <georg@python.org>
parents:
42604
diff
changeset
|
141 |
|
734fc0a19657
#1492: allow overriding BaseHTTPServer's content type for error messages.
Georg Brandl <georg@python.org>
parents:
42604
diff
changeset
|
142 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
143 .. attribute:: protocol_version |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
144 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
145 This specifies the HTTP protocol version used in responses. If set to |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
146 ``'HTTP/1.1'``, the server will permit HTTP persistent connections; |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
147 however, your server *must* then include an accurate ``Content-Length`` |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
148 header (using :meth:`send_header`) in all of its responses to clients. |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
149 For backwards compatibility, the setting defaults to ``'HTTP/1.0'``. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
150 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
151 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
152 .. attribute:: MessageClass |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
153 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
154 .. index:: single: Message (in module mimetools) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
155 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
156 Specifies a :class:`rfc822.Message`\ -like class to parse HTTP headers. |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
157 Typically, this is not overridden, and it defaults to |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
158 :class:`mimetools.Message`. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
159 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
160 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
161 .. attribute:: responses |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
162 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
163 This variable contains a mapping of error code integers to two-element tuples |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
164 containing a short and long message. For example, ``{code: (shortmessage, |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
165 longmessage)}``. The *shortmessage* is usually used as the *message* key in an |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
166 error response, and *longmessage* as the *explain* key (see the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
167 :attr:`error_message_format` class variable). |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
168 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
169 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
170 A :class:`BaseHTTPRequestHandler` instance has the following methods: |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
171 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
172 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
173 .. method:: handle() |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
174 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
175 Calls :meth:`handle_one_request` once (or, if persistent connections are |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
176 enabled, multiple times) to handle incoming HTTP requests. You should |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
177 never need to override it; instead, implement appropriate :meth:`do_\*` |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
178 methods. |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
179 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
180 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
181 .. method:: handle_one_request() |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
182 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
183 This method will parse and dispatch the request to the appropriate |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
184 :meth:`do_\*` method. You should never need to override it. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
185 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
186 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
187 .. method:: send_error(code[, message]) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
188 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
189 Sends and logs a complete error reply to the client. The numeric *code* |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
190 specifies the HTTP error code, with *message* as optional, more specific text. A |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
191 complete set of headers is sent, followed by text composed using the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
192 :attr:`error_message_format` class variable. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
193 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
194 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
195 .. method:: send_response(code[, message]) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
196 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
197 Sends a response header and logs the accepted request. The HTTP response |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
198 line is sent, followed by *Server* and *Date* headers. The values for |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
199 these two headers are picked up from the :meth:`version_string` and |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
200 :meth:`date_time_string` methods, respectively. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
201 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
202 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
203 .. method:: send_header(keyword, value) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
204 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
205 Writes a specific HTTP header to the output stream. *keyword* should |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
206 specify the header keyword, with *value* specifying its value. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
207 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
208 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
209 .. method:: end_headers() |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
210 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
211 Sends a blank line, indicating the end of the HTTP headers in the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
212 response. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
213 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
214 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
215 .. method:: log_request([code[, size]]) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
216 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
217 Logs an accepted (successful) request. *code* should specify the numeric |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
218 HTTP code associated with the response. If a size of the response is |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
219 available, then it should be passed as the *size* parameter. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
220 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
221 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
222 .. method:: log_error(...) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
223 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
224 Logs an error when a request cannot be fulfilled. By default, it passes |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
225 the message to :meth:`log_message`, so it takes the same arguments |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
226 (*format* and additional values). |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
227 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
228 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
229 .. method:: log_message(format, ...) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
230 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
231 Logs an arbitrary message to ``sys.stderr``. This is typically overridden |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
232 to create custom error logging mechanisms. The *format* argument is a |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
233 standard printf-style format string, where the additional arguments to |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
234 :meth:`log_message` are applied as inputs to the formatting. The client |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
235 address and current date and time are prefixed to every message logged. |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
236 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
237 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
238 .. method:: version_string() |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
239 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
240 Returns the server software's version string. This is a combination of the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
241 :attr:`server_version` and :attr:`sys_version` class variables. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
242 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
243 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
244 .. method:: date_time_string([timestamp]) |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
245 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
246 Returns the date and time given by *timestamp* (which must be in the |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
247 format returned by :func:`time.time`), formatted for a message header. If |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
248 *timestamp* is omitted, it uses the current date and time. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
249 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
250 The result looks like ``'Sun, 06 Nov 1994 08:49:37 GMT'``. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
251 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
252 .. versionadded:: 2.5 |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
253 The *timestamp* parameter. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
254 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
255 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
256 .. method:: log_date_time_string() |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
257 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
258 Returns the current date and time, formatted for logging. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
259 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
260 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
261 .. method:: address_string() |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
262 |
|
46555
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
263 Returns the client address, formatted for logging. A name lookup is |
|
66c8bd1bedf3
reformat some documentation of classes so methods and attributes are under the class directive
Benjamin Peterson <benjamin@python.org>
parents:
45449
diff
changeset
|
264 performed on the client's IP address. |
|
42604
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
265 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
266 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
267 .. seealso:: |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
268 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
269 Module :mod:`CGIHTTPServer` |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
270 Extended request handler that supports CGI scripts. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
271 |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
272 Module :mod:`SimpleHTTPServer` |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
273 Basic request handler that limits response to files actually under the document |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
274 root. |
|
9e1529bf0442
Move the 3k reST doc tree in place.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
275 |
