Improved Client2 interface

This commit is contained in:
yhirose committed 2020-05-14 12:51:34 -04:00
1 parent bbb83d12c1
commit 63a96aeb20
2 files changed
+45 -19

No files matched your search

+4 -3
View File
@@ -674,10 +674,11 @@ TEST(HttpsToHttpRedirectTest, Redirect) {
}
TEST(HttpsToHttpRedirectTest2, Redirect) {
httplib::Client2 cli("https://httpbin.org");
cli.set_follow_location(true);
auto res =
cli.Get("/redirect-to?url=http%3A%2F%2Fwww.google.com&status_code=302");
httplib::Client2("https://httpbin.org")
.set_follow_location(true)
.Get("/redirect-to?url=http%3A%2F%2Fwww.google.com&status_code=302");
ASSERT_TRUE(res != nullptr);
EXPECT_EQ(200, res->status);
}