createTestHTTPServerResponse

Creates a HTTPServerResponse suitable for writing unit tests.

@safe
createTestHTTPServerResponse
(
OutputStream data_sink = null
,
SessionStore session_store = null
,)

Parameters

data_sink OutputStream

Optional output stream that captures the data that gets written to the response

session_store SessionStore

Optional session store to use when sessions are involved

data_mode TestHTTPResponseMode

If set to TestHTTPResponseMode.bodyOnly, only the body contents get written to data_sink. Otherwise the raw response including the HTTP header is written.

Meta