Class HttpRequestFailedException
- Namespace
- Mailtrap.Core.Exceptions
- Assembly
- Mailtrap.Abstractions.dll
Exception which is thrown when the request sent to the Mailtrap API was not valid.
public sealed class HttpRequestFailedException : MailtrapApiException, ISerializable
- Inheritance
-
HttpRequestFailedException
- Implements
- Inherited Members
Constructors
HttpRequestFailedException(Uri, HttpMethod, HttpStatusCode, string, string?)
requestUri
and httpMethod
.
Additionally provides
statusCode
and content which were received as a response.
public HttpRequestFailedException(Uri requestUri, HttpMethod httpMethod, HttpStatusCode statusCode, string reason, string? message = null)
Parameters
requestUri
Uri- API endpoint that thrown exception.
httpMethod
HttpMethod- HTTP method that thrown exception.
statusCode
HttpStatusCodeHTTP status code that was returned.
reason
stringHTTP status reason that was returned.
message
stringText representation of the error.
Exceptions
- ArgumentNullException
When the
requestUri
orhttpMethod
is null.- ArgumentNullException
When the
statusCode
is null.
Properties
Reason
Gets HTTP status reason that was returned.
public string Reason { get; }
Property Value
- string
HTTP status reason that was returned.
StatusCode
Gets HTTP status code that was returned.
public HttpStatusCode StatusCode { get; }
Property Value
- HttpStatusCode
HTTP status code that was returned.