使用英语阅读

通过


HttpRequestException 构造函数

定义

初始化 HttpRequestException 类的新实例。

重载

HttpRequestException()

初始化 HttpRequestException 类的新实例。

HttpRequestException(String)

使用特定的描述当前异常的消息初始化 HttpRequestException 类的新实例。

HttpRequestException(String, Exception)

使用特定的描述当前异常和内部异常的消息初始化 HttpRequestException 类的新实例。

HttpRequestException(String, Exception, Nullable<HttpStatusCode>)

使用特定的描述当前异常、内部异常和 HTTP 状态代码的消息初始化 HttpRequestException 类的新实例。

HttpRequestException(HttpRequestError, String, Exception, Nullable<HttpStatusCode>)

使用特定消息(内部异常、HTTP 状态代码和 HttpRequestError)初始化 类的新实例HttpRequestException

HttpRequestException()

Source:
HttpRequestException.cs
Source:
HttpRequestException.cs
Source:
HttpRequestException.cs

初始化 HttpRequestException 类的新实例。

public:
 HttpRequestException();
public HttpRequestException ();
Public Sub New ()

适用于

.NET 9 和其他版本
产品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

HttpRequestException(String)

Source:
HttpRequestException.cs
Source:
HttpRequestException.cs
Source:
HttpRequestException.cs

使用特定的描述当前异常的消息初始化 HttpRequestException 类的新实例。

public:
 HttpRequestException(System::String ^ message);
public HttpRequestException (string message);
public HttpRequestException (string? message);
new System.Net.Http.HttpRequestException : string -> System.Net.Http.HttpRequestException
Public Sub New (message As String)

参数

message
String

描述当前异常的消息。

适用于

.NET 9 和其他版本
产品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

HttpRequestException(String, Exception)

Source:
HttpRequestException.cs
Source:
HttpRequestException.cs
Source:
HttpRequestException.cs

使用特定的描述当前异常和内部异常的消息初始化 HttpRequestException 类的新实例。

public:
 HttpRequestException(System::String ^ message, Exception ^ inner);
public HttpRequestException (string message, Exception inner);
public HttpRequestException (string? message, Exception? inner);
new System.Net.Http.HttpRequestException : string * Exception -> System.Net.Http.HttpRequestException
Public Sub New (message As String, inner As Exception)

参数

message
String

描述当前异常的消息。

inner
Exception

内部异常。

适用于

.NET 9 和其他版本
产品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

HttpRequestException(String, Exception, Nullable<HttpStatusCode>)

Source:
HttpRequestException.cs
Source:
HttpRequestException.cs
Source:
HttpRequestException.cs

使用特定的描述当前异常、内部异常和 HTTP 状态代码的消息初始化 HttpRequestException 类的新实例。

public:
 HttpRequestException(System::String ^ message, Exception ^ inner, Nullable<System::Net::HttpStatusCode> statusCode);
public HttpRequestException (string? message, Exception? inner, System.Net.HttpStatusCode? statusCode);
new System.Net.Http.HttpRequestException : string * Exception * Nullable<System.Net.HttpStatusCode> -> System.Net.Http.HttpRequestException
Public Sub New (message As String, inner As Exception, statusCode As Nullable(Of HttpStatusCode))

参数

message
String

描述当前异常的消息。

inner
Exception

内部异常。

statusCode
Nullable<HttpStatusCode>

HTTP 状态代码。

适用于

.NET 9 和其他版本
产品 版本
.NET 5, 6, 7, 8, 9

HttpRequestException(HttpRequestError, String, Exception, Nullable<HttpStatusCode>)

Source:
HttpRequestException.cs
Source:
HttpRequestException.cs

使用特定消息(内部异常、HTTP 状态代码和 HttpRequestError)初始化 类的新实例HttpRequestException

public HttpRequestException (System.Net.Http.HttpRequestError httpRequestError, string? message = default, Exception? inner = default, System.Net.HttpStatusCode? statusCode = default);
new System.Net.Http.HttpRequestException : System.Net.Http.HttpRequestError * string * Exception * Nullable<System.Net.HttpStatusCode> -> System.Net.Http.HttpRequestException
Public Sub New (httpRequestError As HttpRequestError, Optional message As String = Nothing, Optional inner As Exception = Nothing, Optional statusCode As Nullable(Of HttpStatusCode) = Nothing)

参数

httpRequestError
HttpRequestError

导致异常的 HttpRequestError

message
String

描述当前异常的消息。

inner
Exception

内部异常。

statusCode
Nullable<HttpStatusCode>

HTTP 状态代码。

适用于

.NET 9 和 .NET 8
产品 版本
.NET 8, 9