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

@@ -235,4 +235,25 @@ void ServiceRequest::setMethod(const HttpRequest::Method method)
method_ = method;
}
void ServiceRequest::setHeader(const ServiceRequest::ParameterNameType &name,
const ServiceRequest::ParameterValueType &value)
{
headers_[name] = value;
}
ServiceRequest::ParameterValueType ServiceRequest::getHeader(const ServiceRequest::ParameterNameType &name)
{
return headers_[name];
}
void ServiceRequest::removeHeader(const ServiceRequest::ParameterNameType &name)
{
headers_.erase(name);
}
ServiceRequest::ParameterCollection ServiceRequest::headers() const
{
return headers_;
}
} // namespace AlibabaCloud