#NEWLINE# def request( self , **request ) : #NEWLINE# #INDENT# '\n        Similar to parent class, but returns the request object as soon as it\n        has created it.\n        ' #NEWLINE# environ = { #NEWLINE# #INDENT# 'HTTP_COOKIE' : self . cookies , #NEWLINE# 'PATH_INFO' : '/' , #NEWLINE# 'QUERY_STRING' : '' , #NEWLINE# 'REQUEST_METHOD' : 'GET' , #NEWLINE# 'SCRIPT_NAME' : '' , #NEWLINE# 'SERVER_NAME' : 'testserver' , #NEWLINE# 'SERVER_PORT' : 80 , #NEWLINE# 'SERVER_PROTOCOL' : 'HTTP/1.1' , #NEWLINE# #UNINDENT# } #NEWLINE# environ . update ( environ . defaults ) #NEWLINE# environ . update ( request ) #NEWLINE# request = WSGIRequest ( environ ) #NEWLINE# handler = BaseHandler ( ) #NEWLINE# handler . load_middleware ( ) #NEWLINE# for middleware_method in handler . _request_middleware : #NEWLINE# #INDENT# if middleware_method ( request ) : #NEWLINE# #INDENT# raise Exception ( "Couldn't create request object - request middleware returned a response" ) #NEWLINE# #UNINDENT# #UNINDENT# return request