supported request headers operation

This commit is contained in:
Axios
2019-12-16 23:19:52 +08:00
committed by GitHub
parent 895d40a767
commit 175996b239
9 changed files with 71 additions and 31 deletions

View File

@@ -102,6 +102,12 @@ HttpRequest RoaServiceClient::buildHttpRequest(const std::string & endpoint,
request.setReadTimeout(configuration().readTimeout());
}
for(const auto &h : msg.headers()){
if(!h.second.empty()){
request.setHeader(h.first, h.second);
}
}
if (msg.parameter("Accept").empty()) {
request.setHeader("Accept", "application/json");
} else {