wsgiref.util.request_uri()

wsgiref.util.request_uri(environ, include_query=True) Return the full request URI, optionally including the query string, using the algorithm found in the “URL Reconstruction” section of PEP 3333. If include_query is false, the query string is not included in the resulting URI.

wsgiref.util.is_hop_by_hop()

wsgiref.util.is_hop_by_hop(header_name) Return true if ‘header_name’ is an HTTP/1.1 “Hop-by-Hop” header, as defined by RFC 2616.

wsgiref.util.guess_scheme()

wsgiref.util.guess_scheme(environ) Return a guess for whether wsgi.url_scheme should be “http” or “https”, by checking for a HTTPS environment variable in the environ dictionary. The return value is a string. This function is useful when creating a gateway that wraps CGI or a CGI-like protocol such as FastCGI. Typically, servers providing such protocols will include a HTTPS variable with a value of “1” “yes”, or “on” when a request is received via SSL. So, this function returns “https” if su

wsgiref.util.FileWrapper

class wsgiref.util.FileWrapper(filelike, blksize=8192) A wrapper to convert a file-like object to an iterator. The resulting objects support both __getitem__() and __iter__() iteration styles, for compatibility with Python 2.1 and Jython. As the object is iterated over, the optional blksize parameter will be repeatedly passed to the filelike object’s read() method to obtain bytestrings to yield. When read() returns an empty bytestring, iteration is ended and is not resumable. If filelike has

wsgiref.util.application_uri()

wsgiref.util.application_uri(environ) Similar to request_uri(), except that the PATH_INFO and QUERY_STRING variables are ignored. The result is the base URI of the application object addressed by the request.

wsgiref.simple_server.WSGIServer.set_app()

set_app(application) Sets the callable application as the WSGI application that will receive requests.

wsgiref.simple_server.WSGIServer.get_app()

get_app() Returns the currently-set application callable.

wsgiref.simple_server.WSGIServer

class wsgiref.simple_server.WSGIServer(server_address, RequestHandlerClass) Create a WSGIServer instance. server_address should be a (host,port) tuple, and RequestHandlerClass should be the subclass of http.server.BaseHTTPRequestHandler that will be used to process requests. You do not normally need to call this constructor, as the make_server() function can handle all the details for you. WSGIServer is a subclass of http.server.HTTPServer, so all of its methods (such as serve_forever() and

wsgiref.simple_server.WSGIRequestHandler.handle()

handle() Process the HTTP request. The default implementation creates a handler instance using a wsgiref.handlers class to implement the actual WSGI application interface.

wsgiref.simple_server.WSGIRequestHandler.get_stderr()

get_stderr() Return the object that should be used as the wsgi.errors stream. The default implementation just returns sys.stderr.