.Net 4.0 HttpClient usage?

前端 未结 1 2302
谎友^
谎友^ 2021-02-20 17:47

im in .Net 4.0 and attempting to use the HttpClient. I read some articles saying that it was no longer supported in 4.0 but that you could still use it? i\'ve included the

相关标签:
1条回答
  • 2021-02-20 18:36

    As per MSDN HttpClient is supported only in .NET Framework 4.5. Nevertheless there is an implementation of HttpClient for .NET 4.0. You can download it here:

    HttpClient for .NET 4.0

    MSDN: HttpClient

    Still there are some differences in implementations. For example in version for .NET 4.0 there is no constructor w/ 2 parameters. Please see the source code for more information:

    HttpClient for .NET 4.0 source code

    Regarding your example:

    • There is no constructor w/ 2 params in impl. for .NET 4.0
    • There is no Get method w/ 2 params in impl. for .NET 4.0
    • There is no TransportSettings property in impl. for .NET 4.0
    0 讨论(0)
提交回复
热议问题