vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

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

NameDescription
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.bodyOnly, only the body contents get written to data_sink. Otherwise the raw response including the HTTP header is written.
Authors

Sönke Ludwig, Jan Krüger, Ilya Shipunov

Copyright

© 2012-2017 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.