@SirRufo mentioned the solution in the comments, but did not post it as soltion, so I will explain it here.
The http POST method doesn't really have a clue about arrays. Instead of having square brackets in the field names, this is just a convention.
This sample code works:
var restClient = new RestSharp.RestClient("https://api.crowdin.com"); var request = new RestSharp.RestRequest($"api/project/{projectIdentifier}/add-file", RestSharp.Method.POST); request.AlwaysMultipartFormData = true; request.AddHeader("Content-Type", "multipart/form-data"); request.AddQueryParameter("key", projectKey); request.AddQueryParameter("json", ""); request.AddFile("files[testfile1.pot]", fileName); request.AddFile("files[testfile2.pot]", fileName);
No need to embed custom parameters or anything like that. Adding files with this βspecialβ name is all that is required.
My mistake was that the files[filenamehere.txt] implied a more complex POST body than it really needed.
source share