Platforms: Unix
A HTTP/1.1 Web server with WSGI application interface.
Usage:
def hello_world(environ, start_response):
start_response("200 OK", [])
return ["<html>Hello, world!</html>"]
server = WSGIServer(hello_world)
server.serve(('localhost', 8080))
Create a new WSGIServer serving the given application. Optionally the request_log_level can be given. This loglevel is used for logging the requests.
A HTTP 1.1 Client.
Usage:
#create an instance of this class and connect to a webserver using the connect method:
cnn = HTTPConnection()
cnn.connect(('www.google.com', 80))
#create a GET request using the get method:
request = cnn.get('/index.html')
#finally perform the request to get a response:
response = cnn.perform(request)
#do something with the response:
print response.body
A class representing a HTTP request.
Create a new http request for path using method to host.
Represents a HTTP Response.