如何在netcore

时间:2017-01-20 05:04:31

标签: upload asp.net-core webclient webclient.uploaddata

netframework 4.6中的示例代码

byte[] myByte = etc;

WebClient webClient = new WebClient();
webClient.Headers.Clear();
webClient.Headers.Add("Content-Type", "application/json");
webClient.Headers.Add("Authorization", "Bearer " + ChannelAccessToken);

var a1 = webClient.DownloadData("https://api.myweb.com/1");
var b1 = webClient.UploadData("https://api.myweb.com/2", myByte );

在网络框架中,我可以使用此代码将字节数组上传到链接网络,我现在想要上传/下载我需要更改为编写网络核心如何在网络核心中编写此代码?

0 个答案:

没有答案