Interface IHttpErrorResponse
- Namespace
- Kampute.HttpClient.Interfaces
- Assembly
- Kampute.HttpClient.dll
Defines an interface for handling HTTP error responses and converting them into a HttpResponseException.
public interface IHttpErrorResponse
Remarks
This interface is especially beneficial in RESTful operation contexts where the server provides error details in a distinct format. It facilitates the conversion of these details into a structured HttpResponseException, thereby enhancing error handling and its integration into client-side logic.
Methods
ToException(HttpStatusCode)
Converts the object into a HttpResponseException.
HttpResponseException ToException(HttpStatusCode statusCode)
Parameters
statusCode
HttpStatusCodeThe HTTP status code associated with the error.
Returns
- HttpResponseException
A HttpResponseException that represents the error.