Class HttpContentException
- Namespace
- Kampute.HttpClient
- Assembly
- Kampute.HttpClient.dll
The exception that is thrown when an invalid or unsupported content is encountered in an HTTP response.
public class HttpContentException : Exception, ISerializable
- Inheritance
-
HttpContentException
- Implements
- Inherited Members
- Extension Methods
Constructors
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
message
stringThe 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
message
stringThe error message that explains the reason for the exception.
innerException
ExceptionThe exception that is the cause of the current exception, or a null reference if no inner exception is specified.
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.