Does HttpWebRequest's limit of 2 connections per host apply to HttpClient?

后端 未结 1 844
闹比i
闹比i 2020-12-11 19:24

Does anybody know, with confidence if the (default) rate limit of 2 connections per host applies to System.Net.Http.HttpClient.

Please state the source of your infor

相关标签:
1条回答
  • 2020-12-11 20:27

    According to the documentation (see the third paragraph of Remarks), HttpClient uses a HttpWebRequest by default. And HttpWebRequest certainly does have the two concurrent connections per host limitation.

    HttpClient doesn't say if the HttpClientHandler (the default) changes any of the defaults in HttpWebRequest. I would suspect not.

    If you want to change that, you'll have to create your own HttpMessageHandler and pass a reference to the HttpClient constructor.

    0 讨论(0)
提交回复
热议问题