class test_response
#
-
class test_response#
A type representing server’s outgoing response for testing purpose.
Public Functions
-
inline auto status() const noexcept -> const http::status_code&#
Get HTTP status code.
-
inline auto headers() const noexcept -> const http::header_map&#
Get HTTP headers.
-
inline auto body() noexcept -> any_async_readable_stream&#
Get body.
-
inline auto body() const noexcept -> const any_async_readable_stream&#
Get body.
-
inline auto as_string() -> awaitable<expected<std::string, std::error_code>>#
Read complete body as
std::string
.
-
template<typename Byte>
inline auto as_vector() -> awaitable<expected<std::vector<Byte>, std::error_code>># Read complete body as
std::vector<Byte>
.
-
inline auto as_file(const std::string &path) -> awaitable<expected<std::size_t, std::error_code>>#
Read complete body into file.
-
inline auto status() const noexcept -> const http::status_code&#