Skip to content

Instantly share code, notes, and snippets.

@blogcraft
Created April 4, 2022 15:08
Show Gist options
  • Save blogcraft/810c560c65ccdc87e8dc7690e3427828 to your computer and use it in GitHub Desktop.
Save blogcraft/810c560c65ccdc87e8dc7690e3427828 to your computer and use it in GitHub Desktop.
Genera una URL a la documentación del Internet Engineering Task Force (IETF) según el HTTP Status Code
public static readonly Dictionary<int, string> RFC7231 = new Dictionary<int, string> {
{ 400, "6.5.1" },
{ 402, "6.5.2" },
{ 403, "6.5.3" },
{ 404, "6.5.4" },
{ 405, "6.5.5" },
{ 406, "6.5.6" },
{ 408, "6.5.7" },
{ 409, "6.5.8" },
{ 410, "6.5.9" },
{ 411, "6.5.10" },
{ 413, "6.5.11" },
{ 414, "6.5.12" },
{ 415, "6.5.13" },
{ 417, "6.5.14" },
{ 426, "6.5.15" },
{ 500, "6.6.1" },
{ 501, "6.6.2" },
{ 502, "6.6.3" },
{ 503, "6.6.4" },
{ 504, "6.6.5" },
{ 505, "6.6.6" },
};
public string IetfURL(int statusCode) => $"https://datatracker.ietf.org/doc/html/rfc7231#section-{RFC7231[statusCode]}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment