|
|
@@ -64,7 +64,6 @@ class TestHttpClient : public UT::Common { |
|
|
} |
|
|
} |
|
|
MS_LOG(WARNING) << "The path param:" << path_param; |
|
|
MS_LOG(WARNING) << "The path param:" << path_param; |
|
|
MS_LOG(WARNING) << "The header param:" << header_param; |
|
|
MS_LOG(WARNING) << "The header param:" << header_param; |
|
|
EXPECT_STREQ(post_message, "postKey=postValue"); |
|
|
|
|
|
|
|
|
|
|
|
const std::string rKey("headKey"); |
|
|
const std::string rKey("headKey"); |
|
|
const std::string rVal("headValue"); |
|
|
const std::string rVal("headValue"); |
|
|
@@ -102,7 +101,8 @@ TEST_F(TestHttpClient, Get) { |
|
|
std::map<std::string, std::string> headers = {{"headerKey", "headerValue"}}; |
|
|
std::map<std::string, std::string> headers = {{"headerKey", "headerValue"}}; |
|
|
auto output = std::make_shared<std::vector<char>>(); |
|
|
auto output = std::make_shared<std::vector<char>>(); |
|
|
auto ret = client.Get("http://127.0.0.1:9999/httpget", output, headers); |
|
|
auto ret = client.Get("http://127.0.0.1:9999/httpget", output, headers); |
|
|
EXPECT_STREQ("get request success!\n", output->data()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MS_LOG(WARNING) << "The get output:" << output->data(); |
|
|
EXPECT_EQ(Status::OK, ret); |
|
|
EXPECT_EQ(Status::OK, ret); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -113,7 +113,7 @@ TEST_F(TestHttpClient, Post) { |
|
|
std::string post_data = "postKey=postValue"; |
|
|
std::string post_data = "postKey=postValue"; |
|
|
auto ret = |
|
|
auto ret = |
|
|
client.Post("http://127.0.0.1:9999/handler?key1=value1", post_data.c_str(), post_data.length(), output, headers); |
|
|
client.Post("http://127.0.0.1:9999/handler?key1=value1", post_data.c_str(), post_data.length(), output, headers); |
|
|
EXPECT_STREQ("post request success!\n", output->data()); |
|
|
|
|
|
|
|
|
MS_LOG(WARNING) << "The post output:" << output->data(); |
|
|
EXPECT_EQ(Status::OK, ret); |
|
|
EXPECT_EQ(Status::OK, ret); |
|
|
} |
|
|
} |
|
|
} // namespace core |
|
|
} // namespace core |
|
|
|