I need to upload an apk to hockeyApp with c#'s HttpClient,
the cUrl to upload an apk is the following:
curl \
-F "status=2" \
-F "notify=1" \
-F "ipa=@hockeyapp.ipa" \
-H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
https://rink.hockeyapp.net/api/2/apps/upload
i tried to do the same with c#:
var stream = await File.ReadAllBytesAsync(apkFilePath);
var bytes = new ByteArrayContent(stream);
bytes.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
var multipartFormDataContent = new MultipartFormDataContent
{
//send form text values here
{new StringContent("2"), "status"},
{new StringContent("0"), "notify"},
// send file Here
{bytes, "ipa"}
};
var uri = "https://rink.hockeyapp.net/api/2/apps/upload";
multipartFormDataContent.Headers.Add("X-HockeyAppToken", "++token_here++");
var response = await _client.PostAsync(uri, multipartFormDataContent);
but the response i am getting (after a long period) is 422 unprocessable entity