mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 22:50:53 +00:00
update cpprest petstore samples
This commit is contained in:
parent
8698444fb2
commit
b1e7a4f724
@ -136,8 +136,11 @@ pplx::task<web::http::http_response> ApiClient::callApi(
|
|||||||
{
|
{
|
||||||
body_data[kvp.first] = ModelBase::toJson(kvp.second);
|
body_data[kvp.first] = ModelBase::toJson(kvp.second);
|
||||||
}
|
}
|
||||||
|
if (!formParams.empty())
|
||||||
|
{
|
||||||
request.set_body(body_data);
|
request.set_body(body_data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
web::http::uri_builder formData;
|
web::http::uri_builder formData;
|
||||||
@ -145,10 +148,13 @@ pplx::task<web::http::http_response> ApiClient::callApi(
|
|||||||
{
|
{
|
||||||
formData.append_query(kvp.first, kvp.second);
|
formData.append_query(kvp.first, kvp.second);
|
||||||
}
|
}
|
||||||
|
if (!formParams.empty())
|
||||||
|
{
|
||||||
request.set_body(formData.query(), U("application/x-www-form-urlencoded"));
|
request.set_body(formData.query(), U("application/x-www-form-urlencoded"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
web::http::uri_builder builder(path);
|
web::http::uri_builder builder(path);
|
||||||
for (auto& kvp : queryParams)
|
for (auto& kvp : queryParams)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user