HttpRequestException 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 HttpRequestException 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| HttpRequestException() |
初始化 HttpRequestException 類別的新執行個體。 |
| HttpRequestException(String) |
初始化該類別的新實例 HttpRequestException ,並以特定訊息描述當前例外。 |
| HttpRequestException(String, Exception) |
初始化該類別的新實例 HttpRequestException ,並以特定訊息描述目前例外及內部例外。 |
| HttpRequestException(String, Exception, Nullable<HttpStatusCode>) |
初始化一個新的類別實例 HttpRequestException ,並以特定訊息描述目前例外、一個內部例外及 HTTP 狀態碼。 |
| HttpRequestException(HttpRequestError, String, Exception, Nullable<HttpStatusCode>) |
初始化類別的新實例 HttpRequestException ,包含特定訊息、內部例外、HTTP 狀態碼及 HttpRequestError。 |
HttpRequestException()
初始化 HttpRequestException 類別的新執行個體。
public:
HttpRequestException();
public HttpRequestException();
Public Sub New ()
適用於
HttpRequestException(String)
初始化該類別的新實例 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
一則描述目前例外的訊息。
適用於
HttpRequestException(String, Exception)
初始化該類別的新實例 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
內心的例外。
適用於
HttpRequestException(String, Exception, Nullable<HttpStatusCode>)
初始化一個新的類別實例 HttpRequestException ,並以特定訊息描述目前例外、一個內部例外及 HTTP 狀態碼。
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 狀態代碼。
適用於
HttpRequestException(HttpRequestError, String, Exception, Nullable<HttpStatusCode>)
初始化類別的新實例 HttpRequestException ,包含特定訊息、內部例外、HTTP 狀態碼及 HttpRequestError。
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 狀態代碼。