VkHttpRequestHelper --> public static async void Upload(...)
var httpClient = new Windows.Web.Http.HttpClient();
HttpMultipartFormDataContent content = new HttpMultipartFormDataContent();
content.Add(new HttpStreamContent(data.AsInputStream()), paramName, fileName ?? "myDataFile");
---> content.Headers.Add("Content-Type", uploadContentType); <---
var postAsyncOp = httpClient.PostAsync(new Uri(uri, UriKind.Absolute), content);
Error in line content.Headers.Add("Content-Type", uploadContentType); key Content-type is already exist in Header.
1) content.Headers.ContentType = new Windows.Web.Http.Headers.HttpMediaTypeHeaderValue("image/jpeg"); Doesn`t help.
2) Without this string Server response is "400 Bad request"
For UWP app I need this method. Thanks in advance!
VkHttpRequestHelper --> public static async void Upload(...)
var httpClient = new Windows.Web.Http.HttpClient(); HttpMultipartFormDataContent content = new HttpMultipartFormDataContent(); content.Add(new HttpStreamContent(data.AsInputStream()), paramName, fileName ?? "myDataFile"); ---> content.Headers.Add("Content-Type", uploadContentType); <--- var postAsyncOp = httpClient.PostAsync(new Uri(uri, UriKind.Absolute), content);
Error in line content.Headers.Add("Content-Type", uploadContentType); key Content-type is already exist in Header.
1) content.Headers.ContentType = new Windows.Web.Http.Headers.HttpMediaTypeHeaderValue("image/jpeg"); Doesn`t help. 2) Without this string Server response is "400 Bad request"
For UWP app I need this method. Thanks in advance!