<PackageReference Include="Refit" Version="16.3.0" />

Refit.ApiExceptionBase

public abstract class ApiExceptionBase : Exception
Represents an error that occurred while sending an API request.
public bool HasRequestContent { get; }

Gets a value indicating whether the captured request content is available.

public HttpMethod HttpMethod { get; }

Gets the HTTP method used to send the request.

public RefitSettings RefitSettings { get; }

Gets the Refit settings used to send the request.

public string RequestContent { get; set; }

Gets or sets the request body content as a string, captured before sending. This is only populated when CaptureRequestContent is enabled; otherwise the request content has already been disposed by HttpClient and cannot be read from RequestMessage.

Gets the HTTP Request message used to send the request.

public Uri Uri { get; }

Gets the Uri used to send the HTTP request.

protected ApiExceptionBase(HttpRequestMessage message, HttpMethod httpMethod, RefitSettings refitSettings, Exception innerException)

Initializes a new instance of the ApiExceptionBase class.

protected ApiExceptionBase(string exceptionMessage, HttpRequestMessage message, HttpMethod httpMethod, RefitSettings refitSettings)

Initializes a new instance of the ApiExceptionBase class with a custom exception message.

protected ApiExceptionBase(string exceptionMessage, HttpRequestMessage message, HttpMethod httpMethod, RefitSettings refitSettings, Exception innerException)

Initializes a new instance of the ApiExceptionBase class with a custom exception message.