HttpContentException Class
- Namespace
- Kampute.HttpClient
- Assembly
- Kampute.HttpClient.dll
Definition
The exception that is thrown when an invalid or unsupported content is encountered in an HTTP response.
public class HttpContentException : ExceptionConstructors
HttpContentException()
Initializes a new instance of the HttpContentException class.
public HttpContentException()HttpContentException(string)
Initializes a new instance of the HttpContentException class with a specified error message.
public HttpContentException(string message)Parameters
messagestring- The message that describes the error.
HttpContentException(string, Exception)
Initializes a new instance of the HttpContentException class with a specified error message and a reference to the inner exception that is the cause of this exception.
public HttpContentException(string message, Exception innerException)Parameters
Properties
Content
Gets or sets the HTTP content associated with the exception.
public HttpContent Content { get; set; }Property Value
- HttpContent
- The HTTP content associated with the exception, if any.
ObjectType
Gets or sets the expected type for deserialization when the exception occurred.
public Type ObjectType { get; set; }Property Value
- Type
- The type expected to be deserialized from the HTTP content, if any.
Methods
ToString()
Creates and returns a string representation of the current exception.
public override string ToString()Returns
- string
- A string representation of the current exception.
Extension Methods
| IsTransientNetworkError(this Exception) | Determines whether a given exception can be considered as a transient network issue for the purposes of retrying an HTTP request. |
