Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

VkHttpRequestHelper bug in Upload() via Http.HttpClient() for non-Silverlight app #26

Open
sulesh92 opened this issue Apr 4, 2017 · 1 comment

Comments

@sulesh92
Copy link

sulesh92 commented Apr 4, 2017

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!

@V1460kw
Copy link

V1460kw commented Jul 26, 2017

Ok

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants