Skip to content

Commit c8d3391

Browse files
committed
Added a test case for #400
1 parent 2e496f0 commit c8d3391

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/post_tests.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,15 @@ TEST(UrlEncodedPostTests, PostReflectTest) {
425425
EXPECT_EQ(std::to_string(body.length()), response.header["content-length"]);
426426
}
427427

428+
TEST(UrlEncodedPostTests, PostReflectPayloadTest) {
429+
std::string uri = server->GetBaseUrl() + "/header_reflect.html";
430+
cpr::Payload payload = cpr::Payload{{"email", ""}, {"password", ""}, {"devicetoken", ""}};
431+
cpr::Response response = cpr::Post(cpr::Url(uri), cpr::Timeout{10000}, payload);
432+
433+
EXPECT_EQ(ErrorCode::OK, response.error.code);
434+
EXPECT_EQ(200, response.status_code);
435+
}
436+
428437
int main(int argc, char** argv) {
429438
::testing::InitGoogleTest(&argc, argv);
430439
::testing::AddGlobalTestEnvironment(server);

0 commit comments

Comments
 (0)