System.Net.Http.HttpClient vs Windows.Web.Http.HttpClient - What are the main differences?

后端 未结 2 1150
一整个雨季
一整个雨季 2020-12-08 10:03

When developing .NET 4.5 desktop apps for Windows I have been used to use System.Net.Http.HttpClient for all communication with a backend Web API. I am now deve

2条回答
  •  心在旅途
    2020-12-08 10:05

    There is not much to find about it. Some things that come in my mind:

    • The new API doesn't have dependencies to some low-level Windows functions, like the current API does.
    • The new API is better capable handling new methods related to the HTTP protocol, like WebSockets, etc.

    Some useful information can be found in this blog post which also referenced this Build video. They speak about better cache control, and a way to add filters for authentication, easy access to cookies, reconnecting, etc.

提交回复
热议问题