HttpRequestException Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the HttpRequestException class.
HttpRequestException() |
Initializes a new instance of the HttpRequestException class. |
HttpRequestException(String) |
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception. |
HttpRequestException(String, Exception) |
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception and an inner exception. |
HttpRequestException(String, Exception, Nullable<HttpStatusCode>) |
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception, an inner exception, and an HTTP status code. |
HttpRequestException(HttpRequestError, String, Exception, Nullable<HttpStatusCode>) |
Initializes a new instance of the HttpRequestException class with a specific message an inner exception, and an HTTP status code and an HttpRequestError. |
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
Initializes a new instance of the HttpRequestException class.
public:
HttpRequestException();
public HttpRequestException();
Public Sub New ()
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.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 |
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception.
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)
Parameters
- message
- String
A message that describes the current exception.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.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 |
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception and an inner exception.
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)
Parameters
- message
- String
A message that describes the current exception.
- inner
- Exception
The inner exception.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.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 |
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception, an inner exception, and an HTTP status code.
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))
Parameters
- message
- String
A message that describes the current exception.
- inner
- Exception
The inner exception.
- statusCode
- Nullable<HttpStatusCode>
The HTTP status code.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | 5, 6, 7, 8, 9 |
- Source:
- HttpRequestException.cs
- Source:
- HttpRequestException.cs
Initializes a new instance of the HttpRequestException class with a specific message an inner exception, and an HTTP status code and an 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)
Parameters
- httpRequestError
- HttpRequestError
The HttpRequestError that caused the exception.
- message
- String
A message that describes the current exception.
- inner
- Exception
The inner exception.
- statusCode
- Nullable<HttpStatusCode>
The HTTP status code.
Applies to
.NET 9 and .NET 8
Product | Versions |
---|---|
.NET | 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: