Known subclasses: twisted.web.test.test_wsgi.ApplicationTests, twisted.web.test.test_wsgi.EnvironTests, twisted.web.test.test_wsgi.InputStreamTestMixin, twisted.web.test.test_wsgi.StartResponseTests

Instance Variable channelFactory A no-argument callable which will be invoked to create a new HTTP channel to associate with request objects.
Method setUp Undocumented
Method lowLevelRender
Method render Undocumented
Method requestFactoryFactory Undocumented
Method getContentFromResponse Undocumented
Method prepareRequest Prepare a Request which, when a request is received, captures the environ and start_response callable passed to a WSGI app.
channelFactory =
A no-argument callable which will be invoked to create a new HTTP channel to associate with request objects.
def setUp(self):
Undocumented
def lowLevelRender(self, requestFactory, applicationFactory, channelFactory, method, version, resourceSegments, requestSegments, query=None, headers=[], body=None, safe=''):
ParametersmethodA str giving the request method to use.
versionA str like '1.1' giving the request version.
resourceSegmentsA list of unencoded path segments which specifies the location in the resource hierarchy at which the WSGIResource will be placed, eg [''] for /, ['foo', 'bar', ''] for /foo/bar/, etc.
requestSegmentsA list of unencoded path segments giving the request URI.
queryA list of two-tuples of str giving unencoded query argument keys and values.
headersA list of two-tuples of str giving request header names and corresponding values.
safeA str giving the bytes which are to be considered safe for inclusion in the request URI and not quoted.
ReturnsA Deferred which will be called back with a two-tuple of the arguments passed which would be passed to the WSGI application object for this configuration and request (ie, the environment and start_response callable).
def render(self, *a, **kw):
Undocumented
def requestFactoryFactory(self, requestClass=Request):
Undocumented
def getContentFromResponse(self, response):
Undocumented
def prepareRequest(self, application=None):

Prepare a Request which, when a request is received, captures the environ and start_response callable passed to a WSGI app.

ParametersapplicationAn optional WSGI application callable that accepts the familiar environ and start_response args and returns an iterable of body content. If not supplied, start_response will be called with a "200 OK" status and no headers, and no content will be yielded.
ReturnsA two-tuple of (request, deferred). The former is a Twisted Request. The latter is a Deferred which will be called back with a two-tuple of the arguments passed to a WSGI application (i.e. the environ and start_response callable), or will errback with any error arising within the WSGI app.
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.