Class HttpResponseStatusException
Thrown when a response with an unexpected status code is received.
public class HttpResponseStatusException : HttpRequestException, ISerializable
- Inheritance
-
HttpResponseStatusException
- Implements
- Inherited Members
Constructors
HttpResponseStatusException()
Initializes a new instance of the HttpRequestException class.
public HttpResponseStatusException()
HttpResponseStatusException(HttpStatusCode)
Initializes a new instance of the HttpResponseStatusException class with an HTTP status code.
public HttpResponseStatusException(HttpStatusCode statusCode)
Parameters
statusCodeHttpStatusCode- The HTTP status code.
HttpResponseStatusException(string)
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception.
public HttpResponseStatusException(string message)
Parameters
messagestring- A message that describes the current exception.
HttpResponseStatusException(string, Exception)
Initializes a new instance of the HttpRequestException class with a specific message that describes the current exception and an inner exception.
public HttpResponseStatusException(string message, Exception innerException)
Parameters
HttpResponseStatusException(string?, Exception?, HttpStatusCode?)
Initializes a new instance of the HttpResponseStatusException class with a specific message that describes the current exception, an inner exception, and an HTTP status code.
public HttpResponseStatusException(string? message, Exception? inner, HttpStatusCode? statusCode)
Parameters
messagestring- A message that describes the current exception.
innerException- The inner exception.
statusCodeHttpStatusCode?- The HTTP status code.
Properties
IsClientError
Whether the status code represents a client error.
public bool IsClientError { get; }
Property Value
IsServerError
Whether the status code represents a server error.
public bool IsServerError { get; }
Property Value
StatusCode
Gets the HTTP status code to be returned with the exception.
public HttpStatusCode? StatusCode { get; }