@@ -8,19 +8,18 @@ \section{\module{SimpleHTTPServer} ---
88
99
1010The \module {SimpleHTTPServer} module defines a request-handler class,
11- interface compatible with \class {BaseHTTPServer.BaseHTTPRequestHandler}
12- which serves files only from a base directory.
11+ interface- compatible with \class {BaseHTTPServer.BaseHTTPRequestHandler},
12+ that serves files only from a base directory.
1313
1414The \module {SimpleHTTPServer} module defines the following class:
1515
1616\begin {classdesc }{SimpleHTTPRequestHandler}{request, client_address, server}
17- This class is used, to serve files from current directory and below,
17+ This class is used to serve files from the current directory and below,
1818directly mapping the directory structure to HTTP requests.
1919
20- A lot of the work is done by the base class
21- \class {BaseHTTPServer.BaseHTTPRequestHandler}, such as parsing the
22- request. This class implements the \function {do_GET()} and
23- \function {do_HEAD()} functions.
20+ A lot of the work, such as parsing the request, is done by the base
21+ class \class {BaseHTTPServer.BaseHTTPRequestHandler}. This class
22+ implements the \function {do_GET()} and \function {do_HEAD()} functions.
2423\end {classdesc }
2524
2625The \class {SimpleHTTPRequestHandler} defines the following member
@@ -32,7 +31,7 @@ \section{\module{SimpleHTTPServer} ---
3231\end {memberdesc }
3332
3433\begin {memberdesc }{extensions_map}
35- A dictionary mapping suffixes into MIME types. Default is signified
34+ A dictionary mapping suffixes into MIME types. The default is signified
3635by an empty string, and is considered to be \code {application/octet-stream}.
3736The mapping is used case-insensitively, and so should contain only
3837lower-cased keys.
@@ -43,7 +42,7 @@ \section{\module{SimpleHTTPServer} ---
4342\begin {methoddesc }{do_HEAD}{}
4443This method serves the \code {'HEAD'} request type: it sends the
4544headers it would send for the equivalent \code {GET} request. See the
46- \method {do_GET()} method for more complete explanation of the possible
45+ \method {do_GET()} method for a more complete explanation of the possible
4746headers.
4847\end {methoddesc }
4948
@@ -61,13 +60,15 @@ \section{\module{SimpleHTTPServer} ---
6160If the request was mapped to a file, it is opened and the contents are
6261returned. Any \exception {IOError} exception in opening the requested
6362file is mapped to a \code {404}, \code {'File not found'}
64- error. Otherwise, the content type is guessed using the
63+ error. Otherwise, the content type is guessed by calling the
64+ \method {guess_type()} method, which in turn uses the
6565\var {extensions_map} variable.
6666
67- A \code {'Content-type:'} with the guessed content type is output, and
68- then a blank line, signifying end of headers, and then the contents of
69- the file. If the file's MIME type starts with \code {text/} the file is
70- opened in text mode; otherwise binary mode is used.
67+ A \code {'Content-type:'} header with the guessed content type is
68+ output, followed by a blank line signifying the end of the headers,
69+ and then the contents of the file are output. If the file's MIME type
70+ starts with \code {text/} the file is opened in text mode; otherwise
71+ binary mode is used.
7172
7273For example usage, see the implementation of the \function {test()}
7374function.
0 commit comments