Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi,

    This also haunted me and it took me a long time to find out the problem. Actually I analysed a trace from the curl-examples from the API-Documentation and here is the solution, that worked for me:

    In your line
    content.Add(new StreamContent(stream), "media", file.Name);
    you have to use
    "media[]" instead of "media"

    Use multiContent with HttpClient.PostAsync:

    HttpMultipartFormDataContent multiContent = new HttpMultipartFormDataContent();
                HttpStreamContent imageContent = new HttpStreamContent(await file.OpenReadAsync());
                multiContent.Add(imageContent, "media[]", "TheBild.jpg");

    Cheers
    Volker

Viewing 1 replies (of 1 total)