现在,我已经配置了使用HttpClient的UWP照片发布到Web api部分。
Uri uri = new Uri("http://localhost:50040/api/Upload");
IInputStream inputStream = await photoFile.OpenAsync(FileAccessMode.Read);
HttpMultipartFormDataContent multipartContent = new HttpMultipartFormDataContent();
multipartContent.Add(new HttpStreamContent(inputStream), "myFile", photoFile.Name);
Windows.Web.Http.HttpClient newclient = new Windows.Web.Http.HttpClient();
Windows.Web.Http.HttpResponseMessage response = await client.PostAsync(uri, multipartContent);
但是我不知道如何为服务器端设置.NET核心Web API,以获取从UWP应用程序发布的图像。请帮助我,谢谢。
呼如林
相关分类