IHttpErrorResponse Interface

Namespace
Kampute.HttpClient.Interfaces
Assembly
  • Kampute.HttpClient.dll

Definition

Defines an error model that creates the exception for an error response.
public interface IHttpErrorResponse

Remarks

Implement this interface on the type assigned to HttpRestClient.ResponseErrorType to turn the error details that an API returns, such as a message or validation errors, into the HttpResponseException that the client throws.

Methods

ToException(HttpStatusCode)

Converts the object into a HttpResponseException.
HttpResponseException ToException(HttpStatusCode statusCode)

Parameters

statusCode HttpStatusCode
The HTTP status code associated with the error.

Returns

HttpResponseException
A HttpResponseException that represents the error.