File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55#include < format>
66#include < gmock/gmock.h>
77#include < gtest/gtest.h>
8+ #include < print>
89#include < s3cpp/httpclient.h>
910#include < stdexcept>
1011#include < string>
@@ -102,8 +103,6 @@ TEST(HTTP, HTTPRequestCastTimeout) {
102103 EXPECT_EQ (request.getTimeout (), 3600 );
103104}
104105
105- // TODO(cristian): Headers extensive tests
106-
107106TEST (HTTP , HTTPClientDefaultHeadersOverwrittenByRequestHeaders) {
108107 // HttpClient allows setting headers once through a initializer list
109108 // this headers are then merged (and overriden) with the HttpRequest headers
@@ -165,6 +164,16 @@ TEST(HTTP, HTTPHead) {
165164 EXPECT_FALSE (resp.headers ().empty ());
166165}
167166
167+ TEST (HTTP , HTTPHeadStatusCode) {
168+ HttpClient client{};
169+ HttpResponse resp =
170+ client.head (" https://postman-echo.com/get?foo0=bar1&foo2=bar2" ).execute ();
171+ EXPECT_TRUE (resp.is_ok ());
172+ EXPECT_EQ (resp.status (), 200 );
173+ EXPECT_TRUE (resp.body ().empty ());
174+ EXPECT_FALSE (resp.headers ().empty ());
175+ }
176+
168177TEST (HTTP , HTTPHeaderOrder) {
169178 HttpClient client{};
170179 HttpResponse resp1 =
You can’t perform that action at this time.
0 commit comments