Skip to content

Commit

Permalink
fixed HttpClient 未正确处理含有多个值的 HttpParams
Browse files Browse the repository at this point in the history
  • Loading branch information
fasiondog committed Aug 9, 2024
1 parent 6669608 commit 82dc722
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions hikyuu/utilities/http_client/HttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ HttpResponse HttpClient::request(const std::string& method, const std::string& p
for (auto iter = params.cbegin(); iter != params.cend(); ++iter) {
if (first) {
buf << "?";
first = false;
} else {
buf << "&";
}
Expand Down
3 changes: 2 additions & 1 deletion release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## 1.0.5 -

fixed MySQLStatement::sub_getColumnAsBlob 未正确获取 blob 长度
1. fixed MySQLStatement::sub_getColumnAsBlob 未正确获取 blob 长度
2. fixed HttpClient 未正确处理含有多个值的 HttpParams

## 1.0.4 - 2024年8月6日

Expand Down
5 changes: 2 additions & 3 deletions test/utilities/http_client/test_HttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ TEST_CASE("test_HttpClient") {
#endif

try {
cli.setUrl("http://api.vore.top");
res = cli.get("/api/IPdata", {{"ip", "10.0.0.1"}}, HttpHeaders());
cli.setUrl("http://webapi-pc.meitu.com");
res = cli.get("/common/ip_location", {{"ip", "112.97.82.226"}}, HttpHeaders());
if (res.status() == 200) {
auto data = res.json();
HKU_INFO("{}", data.dump());
CHECK_EQ(data["ipinfo"]["text"].get<std::string>(), "10.0.0.1");
} else {
HKU_INFO("res status: {}, body: {}", res.status(), res.body());
}
Expand Down

0 comments on commit 82dc722

Please sign in to comment.