Fix the ambiguity of the contructors of FormPart.

This commit is contained in:
Adam Gu
2019-07-14 09:01:48 +08:00
parent 381b148806
commit 2a20030f7e
4 changed files with 43 additions and 31 deletions
+2 -4
View File
@@ -55,8 +55,7 @@ RequestBuilder& RequestBuilder::File(const std::string& name,
const Path& path,
const std::string& media_type) {
assert(!name.empty());
auto part = std::make_shared<FormPart>(name, path, media_type);
form_parts_.push_back(part);
form_parts_.push_back(FormPart::NewFile(name, path, media_type));
return *this;
}
@@ -64,8 +63,7 @@ RequestBuilder& RequestBuilder::Form(const std::string& name,
std::string&& data,
const std::string& media_type) {
assert(!name.empty());
auto part = std::make_shared<FormPart>(name, std::move(data), media_type);
form_parts_.push_back(part);
form_parts_.push_back(FormPart::New(name, std::move(data), media_type));
return *this;
}