Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59a27f1

Browse files
committed
Various minor edits
1 parent 4cbe95c commit 59a27f1

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

Doc/lib/libsimplehttp.tex

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ \section{\module{SimpleHTTPServer} ---
88

99

1010
The \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

1414
The \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,
1818
directly 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

2625
The \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
3635
by an empty string, and is considered to be \code{application/octet-stream}.
3736
The mapping is used case-insensitively, and so should contain only
3837
lower-cased keys.
@@ -43,7 +42,7 @@ \section{\module{SimpleHTTPServer} ---
4342
\begin{methoddesc}{do_HEAD}{}
4443
This method serves the \code{'HEAD'} request type: it sends the
4544
headers 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
4746
headers.
4847
\end{methoddesc}
4948

@@ -61,13 +60,15 @@ \section{\module{SimpleHTTPServer} ---
6160
If the request was mapped to a file, it is opened and the contents are
6261
returned. Any \exception{IOError} exception in opening the requested
6362
file 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

7273
For example usage, see the implementation of the \function{test()}
7374
function.

0 commit comments

Comments
 (0)