Whats the difference between HttpClient.Timeout and using the WebRequestHandler timeout properties?

前端 未结 2 1813
渐次进展
渐次进展 2020-12-10 04:47

I can set the timeout of my HttpClient object directly with HttpClient.Timeout but I\'ve recently read about the WebRequestHandler cla

2条回答
  •  孤城傲影
    2020-12-10 05:26

    WebRequestHandler.ReadWriteTimeout - Gets or sets a time-out in milliseconds when writing a request to or reading a response from a server.

    HttpClient.Timeout - Gets or sets the TimeSpan to wait before the request times out.

    Here, WebRequestHandler is a wrapper over HTTPClient WebRequestHandler derives from HttpClientHandler but adds properties that generally only are available on full .NET. To conclude, it is more on less same thing.

    For more info refer this link - http://blogs.msdn.com/b/henrikn/archive/2012/08/07/httpclient-httpclienthandler-and-httpwebrequesthandler.aspx

提交回复
热议问题