'Construct a generic request object.'

def request(self, **request):

    request['POST'] = dict()
    request['GET'] = dict()
    request = RequestFactory.request(self, **request)
    handler = BaseHandler()
    handler.load_middleware()
    for middleware_method in handler._request_middleware:
        if middleware_method(request):
            raise Exception("Couldn't    create    request    mock    object    -    request    middleware    returned    a    response")
    return request
