Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit eeca635

Browse files
committed
Added constain for StatusCode UNPROCESSABLE ENTITY 422
1 parent 12b7e9e commit eeca635

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/Constants/StatusCodeLink.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22

33
namespace PowerUtils.Net.Constants
4-
{ // DONE
4+
{
55
// Reference: https://github.com/ofpinewood/http-exceptions/blob/main/src/Opw.HttpExceptions/ResponseStatusCodeLink.cs
66

77
/// <summary>
@@ -29,6 +29,7 @@ public static class StatusCodeLink
2929
public const string UNSUPPORTED_MEDIA_TYPE = "https://tools.ietf.org/html/rfc7231#section-6.5.13";
3030
public const string REQUESTED_RANGE_NOT_SATISFIABLE = "https://tools.ietf.org/html/rfc7233#section-4.4";
3131
public const string EXPECTATION_FAILED = "https://tools.ietf.org/html/rfc7231#section-6.5.14";
32+
public const string UNPROCESSABLE_ENTITY = "https://tools.ietf.org/doc/html/rfc7231#section-6.5";
3233
public const string UPGRADE_REQUIRED = "https://tools.ietf.org/html/rfc7231#section-6.5.15";
3334
public const string INTERNAL_SERVER_ERROR = "https://tools.ietf.org/html/rfc7231#section-6.6.1";
3435
public const string NOT_IMPLEMENTED = "https://tools.ietf.org/html/rfc7231#section-6.6.2";
@@ -65,6 +66,7 @@ public static string GetStatusCodeLink(this int statuCode)
6566
415 => UNSUPPORTED_MEDIA_TYPE,
6667
416 => REQUESTED_RANGE_NOT_SATISFIABLE,
6768
417 => EXPECTATION_FAILED,
69+
422 => UNPROCESSABLE_ENTITY,
6870
426 => UPGRADE_REQUIRED,
6971

7072
// 5XX

tests/ConstantsTests/StatusCodeLinksTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class StatusCodeLinksTests
2727
[InlineData(415, StatusCodeLink.UNSUPPORTED_MEDIA_TYPE)]
2828
[InlineData(416, StatusCodeLink.REQUESTED_RANGE_NOT_SATISFIABLE)]
2929
[InlineData(417, StatusCodeLink.EXPECTATION_FAILED)]
30+
[InlineData(422, StatusCodeLink.UNPROCESSABLE_ENTITY)]
3031
[InlineData(426, StatusCodeLink.UPGRADE_REQUIRED)]
3132
[InlineData(500, StatusCodeLink.INTERNAL_SERVER_ERROR)]
3233
[InlineData(501, StatusCodeLink.NOT_IMPLEMENTED)]

0 commit comments

Comments
 (0)