这个类在 HTTP 请求到达时处理它。实际上它自身并不能对任何 HTTP 请求作出响应,他必须存在派生类用来处理每一个请求方法(例如 GET 或者 POST)。BaseHTTPRequestHandler 为子集提供许多类变量、实例变量和方法。
《通过派生类去处理来自客户端的POST与GET请求的》
classBaseHTTPRequestHandler(
request, client_address, server)
This class is used to handle the HTTP requests that arrive at the server. By
itself, it cannot respond to any actual HTTP requests; it must be subclassed to
handle each request method (e.g. GET or POST). BaseHTTPRequestHandler provides a number of class and instance
variables, and methods for use by subclasses.
这个类的功能就是:处理来自于客户端的请求操作。包括GET或POST的操作的!
本身是不能正确地进行处理请求操作的。必须要通过其子类进行重写它!
struct的功能:This can be used in handling binary data stored in files or from network
connections, among other sources. This module performs conversions between Python values and C structs represented
as Python strings. 4.3 struct -- Interpret strings as packed binary data
pack(
fmt, v1, v2, ...)
Return a string containing the values v1, v2,
... packed according to the given format. The arguments must match the
values required by the format exactly.
1.OS模块 14.1 os -- Miscellaneous operating system interfaces
name
The name of the operating system dependent module imported. The following
names have currently been registered: 'posix', 'nt',
'mac', 'os2', 'ce', 'java',
'riscos'.