bugfix: Made sure that arrays are send as arrays when they only have 1 entry

This applies to account_ids, exclude_types, and media_ids
This commit is contained in:
tastytea 2018-06-14 04:10:08 +02:00
parent 8f30451ec1
commit eaff505f15
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
1 changed files with 8 additions and 1 deletions

View File

@ -114,8 +114,15 @@ const curlpp::Forms API::maptoformdata(const parametermap &map)
}
else
{
string key = it.first;
if (key == "account_ids" ||
key == "exclude_types" ||
key == "media_ids")
{
key += "[]";
}
formdata.push_back(
new curlpp::FormParts::Content(it.first, it.second.front()));
new curlpp::FormParts::Content(key, it.second.front()));
}
}
else