简体   繁体   English

ASP.NET MVC 5 vNext发出Web请求

[英]ASP.NET MVC 5 vNext make web request

I am trying to do a web request from my ASP.NET MVC 6 application to another resource. 我正在尝试从ASP.NET MVC 6应用程序向另一个资源发出Web请求。 I tried to use HttpClient and WebClient but all of these classes are unavailable for me. 我尝试使用HttpClient和WebClient,但是所有这些类对我都不可用。

I tried adding this: 我尝试添加以下内容:

  "frameworks": {
    "dotnet": { },
    "aspnet50": {
      "frameworkAssemblies": {
        "System.Net.Http": "4.0.0.0"
      }
    },
    "aspnetcore50": {
      "dependencies": {
        "System.Net.Http": "4.0.0-beta-*"
      }
    }
  }

But didn't work 但是没用

I needed to add System.Net.Http to my project.json file: 我需要将System.Net.Http添加到我的project.json文件中:

  "dependencies": {
    "System.Net.Http": "4.0.0"
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM