fixed issue #74
This commit is contained in:
@@ -37,9 +37,10 @@ RoaServiceClient::~RoaServiceClient() {
|
||||
}
|
||||
|
||||
RoaServiceClient::JsonOutcome RoaServiceClient::makeRequest(
|
||||
const std::string &endpoint,
|
||||
const RoaServiceRequest &msg, HttpRequest::Method method)const {
|
||||
auto outcome = AttemptRequest(endpoint, msg, method);
|
||||
const std::string &endpoint,
|
||||
const RoaServiceRequest &request, HttpRequest::Method method) const
|
||||
{
|
||||
auto outcome = AttemptRequest(endpoint, request, request.method());
|
||||
if (outcome.isSuccess())
|
||||
return JsonOutcome(std::string(outcome.result().body(),
|
||||
outcome.result().bodySize()));
|
||||
|
||||
@@ -37,9 +37,10 @@ RpcServiceClient::~RpcServiceClient() {
|
||||
}
|
||||
|
||||
RpcServiceClient::JsonOutcome RpcServiceClient::makeRequest(
|
||||
const std::string &endpoint,
|
||||
const RpcServiceRequest &msg, HttpRequest::Method method)const {
|
||||
auto outcome = AttemptRequest(endpoint, msg, method);
|
||||
const std::string &endpoint,
|
||||
const RpcServiceRequest &request, HttpRequest::Method method) const
|
||||
{
|
||||
auto outcome = AttemptRequest(endpoint, request, request.method());
|
||||
if (outcome.isSuccess())
|
||||
return JsonOutcome(std::string(outcome.result().body(),
|
||||
outcome.result().bodySize()));
|
||||
|
||||
@@ -30,7 +30,8 @@ ServiceRequest::ServiceRequest(const std::string &product,
|
||||
version_(version),
|
||||
scheme_("https"),
|
||||
connectTimeout_(kInvalidTimeout),
|
||||
readTimeout_(kInvalidTimeout)
|
||||
readTimeout_(kInvalidTimeout),
|
||||
method_(HttpRequest::Method::Get)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -169,6 +170,11 @@ std::string ServiceRequest::version() const
|
||||
return version_;
|
||||
}
|
||||
|
||||
HttpRequest::Method ServiceRequest::method() const
|
||||
{
|
||||
return method_;
|
||||
}
|
||||
|
||||
void ServiceRequest::setVersion(const std::string &version)
|
||||
{
|
||||
version_ = version;
|
||||
@@ -224,4 +230,9 @@ void ServiceRequest::setReadTimeout(const long readTimeout)
|
||||
readTimeout_ = readTimeout;
|
||||
}
|
||||
|
||||
void ServiceRequest::setMethod(const HttpRequest::Method method)
|
||||
{
|
||||
method_ = method;
|
||||
}
|
||||
|
||||
} // namespace AlibabaCloud
|
||||
|
||||
Reference in New Issue
Block a user