Class HttpStatusCodeExtensions
- Namespace
- Cuemon.Extensions.Net
- Assembly
- Cuemon.Extensions.Net.dll
Extension methods for the HttpStatusCode enum.
public static class HttpStatusCodeExtensions
- Inheritance
-
HttpStatusCodeExtensions
Methods
IsClientErrorStatusCode(HttpStatusCode)
Determines whether the specified statusCode is within the client error related range.
public static bool IsClientErrorStatusCode(this HttpStatusCode statusCode)
Parameters
statusCodeHttpStatusCodeThe HttpStatusCode to evaluate.
Returns
- bool
trueif HttpStatusCode was in the Client Error range (400-499); otherwise,false.
IsInformationStatusCode(HttpStatusCode)
Determines whether the specified statusCode is within the informational range.
public static bool IsInformationStatusCode(this HttpStatusCode statusCode)
Parameters
statusCodeHttpStatusCodeThe HttpStatusCode to evaluate.
Returns
- bool
trueif HttpStatusCode was in the Information range (100-199); otherwise,false.
IsRedirectionStatusCode(HttpStatusCode)
Determines whether the specified statusCode is within the redirecting range.
public static bool IsRedirectionStatusCode(this HttpStatusCode statusCode)
Parameters
statusCodeHttpStatusCodeThe HttpStatusCode to evaluate.
Returns
- bool
trueif HttpStatusCode was in the Redirection range (300-399); otherwise,false.
IsServerErrorStatusCode(HttpStatusCode)
Determines whether the specified statusCode is within the server error related range.
public static bool IsServerErrorStatusCode(this HttpStatusCode statusCode)
Parameters
statusCodeHttpStatusCodeThe HttpStatusCode to evaluate.
Returns
- bool
trueif HttpStatusCode was in the Server Error range (500-599); otherwise,false.
IsSuccessStatusCode(HttpStatusCode)
Determines whether the specified statusCode is within the successful range.
public static bool IsSuccessStatusCode(this HttpStatusCode statusCode)
Parameters
statusCodeHttpStatusCodeThe HttpStatusCode to evaluate.
Returns
- bool
trueif HttpStatusCode was in the Successful range (200-299); otherwise,false.