Function createTestHTTPServerResponse
Creates a HTTPServerResponse suitable for writing unit tests.
HTTPServerResponse createTestHTTPServerResponse
(
OutputStream data_sink = null,
SessionStore session_store = null,
TestHTTPResponseMode data_mode = TestHTTPResponseMode .plain
) @safe;
Parameters
Name | Description |
---|---|
data_sink | Optional output stream that captures the data that gets written to the response |
session_store | Optional session store to use when sessions are involved |
data_mode | If set to TestHTTPResponseMode , only the body
contents get written to data_sink . Otherwise the raw response
including the HTTP header is written. |