asp.net核心1.1读取streamcontent多部分数据

时间:2018-02-27 05:34:44

标签: asp.net-core asp.net-core-1.1

如何拆分从webex文件下载服务

收到的多部分数据
HttpResponseMessage resp;
  using (var client = new HttpClient())
  {
       client.DefaultRequestHeaders.Add("SOAPAction", "downloadNBRStorageFile");
       resp = await client.PostAsync("https://njp1wss.webex.com/nbr/services/NBRStorageService", new StringContent(post));
  }

数据响应类似于

        ------=_Part_604_2105194556.1519707163492
    Content-Type: text/xml; charset=UTF-8
    Content-Transfer-Encoding: binary
    Content-Id: <AEE7D153C4A643E707C0DFCECB351409>

    --- xml data not going to be used here --- 
    ------=_Part_604_2105194556.1519707163492
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: binary
    Content-Id: <6B9F34D3B0038FFEC76B2C53E8ECC54F>

    --- some data neeeded including filename and recordid is here ---
    ------=_Part_604_2105194556.1519707163492
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: binary
    Content-Id: <B7DD56DF3518FC5CE8D69C569F709FEF>

并且最后有二进制文件数据。 流内容似乎没有核心的多部分支持。 我查看了https://www.nuget.org/packages/Microsoft.AspNet.WebApi.Client/,但似乎没有在核心1.1中工作,或者我无法理解它。 (可以将其添加到项目中但不允许我使用它)

使用Visual Studio 2017,在asp.net核心1.1项目中。

我希望我正在做一个简单的错误

0 个答案:

没有答案