Closed NN--- closed 3 years ago
According to the docs the HttpRequestException
is the base* class for exceptions thrown by the HttpClient
and HttpMessageHandler
classes.
*I could not find any derived class in the .NET Framework (checked v4.8 and v5.0.1). The exception class is not sealed, so any library can define derived classes.
** The exception is supposed to be thrown by HttpClient
and HttpMessageHandler
. Actually, there shouldn't be any reason to throw the exception.
Do you have a good reason to throw the HttpRequestException
?
Yeah I wondered too where are derived classes:) I just used it in my test.
Why throwing HttpRequestException is prohibited ?