Charset default to UTF-8 on Windows

This commit is contained in:
xia-chu
2024-04-20 22:25:21 +08:00
parent 44d6457108
commit e4de454d5d
8 changed files with 8 additions and 38 deletions

View File

@@ -66,7 +66,8 @@ void HttpClient::sendRequest(const string &url) {
_http_persistent = true;
if (_body && _body->remainSize()) {
_header.emplace("Content-Length", to_string(_body->remainSize()));
_header.emplace("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
GET_CONFIG(string, charSet, Http::kCharSet);
_header.emplace("Content-Type", "application/x-www-form-urlencoded; charset=" + charSet);
}
bool host_changed = (_last_host != host + ":" + to_string(port)) || (_is_https != is_https);