| 102 | *boost::unit_test::label("http")) |
| 103 | |
| 104 | BOOST_AUTO_TEST_CASE(expect_100_continue) |
| 105 | { |
| 106 | CreateTestUsers(); |
| 107 | SetupHttpServerConnection(true); |
| 108 | |
| 109 | http::request<boost::beast::http::string_body> request; |
| 110 | request.method(http::verb::get); |
| 111 | request.version(11); |
| 112 | request.target("/v1/test"); |
| 113 | request.set(http::field::expect, "100-continue"); |
| 114 | request.set(http::field::host, "localhost:5665"); |
| 115 | request.set(http::field::accept, "application/json"); |
| 116 | request.set(http::field::connection, "close"); |
| 117 | request.content_length(0); |
| 118 | http::request_serializer<http::string_body> sr(request); |
| 119 | http::write_header(*client, sr); |
| 120 | client->flush(); |
| 121 | |
| 122 | flat_buffer buf; |
| 123 | http::response<http::string_body> response; |
| 124 | BOOST_REQUIRE_NO_THROW(http::read(*client, buf, response)); |
| 125 | |
| 126 | BOOST_REQUIRE_EQUAL(response.version(), 11); |
| 127 | BOOST_REQUIRE_EQUAL(response.result(), http::status::continue_); |
| 128 | |
| 129 | http::write(*client, sr); |
| 130 | client->flush(); |
| 131 | |
| 132 | BOOST_REQUIRE_NO_THROW(http::read(*client, buf, response)); |
| 133 | BOOST_REQUIRE_EQUAL(response.version(), 11); |
| 134 | BOOST_REQUIRE_EQUAL(response.result(), http::status::ok); |
| 135 | BOOST_REQUIRE_EQUAL(response.body(), "test"); |
| 136 | |
| 137 | BOOST_REQUIRE(Shutdown(client)); |
| 138 | } |
| 139 | |
| 140 | BOOST_AUTO_TEST_CASE(bad_request) |
| 141 | { |
nothing calls this directly
no test coverage detected