@@ -904,6 +904,12 @@ class ServerTest : public ::testing::Test {
904
904
EXPECT_EQ (body, " content" );
905
905
res.set_content (body, " text/plain" );
906
906
})
907
+ .Post (" /query-string-and-body" ,
908
+ [&](const Request &req, Response & /* res*/ ) {
909
+ ASSERT_TRUE (req.has_param (" key" ));
910
+ EXPECT_EQ (req.get_param_value (" key" ), " value" );
911
+ EXPECT_EQ (req.body , " content" );
912
+ })
907
913
#ifdef CPPHTTPLIB_ZLIB_SUPPORT
908
914
.Get (" /gzip" ,
909
915
[&](const Request & /* req*/ , Response &res) {
@@ -1674,6 +1680,12 @@ TEST_F(ServerTest, PatchContentReceiver) {
1674
1680
ASSERT_EQ (" content" , res->body );
1675
1681
}
1676
1682
1683
+ TEST_F (ServerTest, PostQueryStringAndBody) {
1684
+ auto res = cli_.Post (" /query-string-and-body?key=value" , " content" , " text/plain" );
1685
+ ASSERT_TRUE (res != nullptr );
1686
+ ASSERT_EQ (200 , res->status );
1687
+ }
1688
+
1677
1689
TEST_F (ServerTest, HTTP2Magic) {
1678
1690
Request req;
1679
1691
req.method = " PRI" ;
@@ -1686,6 +1698,7 @@ TEST_F(ServerTest, HTTP2Magic) {
1686
1698
ASSERT_TRUE (ret);
1687
1699
EXPECT_EQ (400 , res->status );
1688
1700
}
1701
+
1689
1702
TEST_F (ServerTest, KeepAlive) {
1690
1703
cli_.set_keep_alive_max_count (4 );
1691
1704
0 commit comments