| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | namespace System.Net |
| | | 5 | | { |
| | | 6 | | internal static class HttpStatusDescription |
| | | 7 | | { |
| | | 8 | | internal static string? Get(HttpStatusCode code) => |
| | 0 | 9 | | Get((int)code); |
| | | 10 | | |
| | | 11 | | internal static string? Get(int code) => |
| | 0 | 12 | | code switch |
| | 0 | 13 | | { |
| | 0 | 14 | | 100 => "Continue", |
| | 0 | 15 | | 101 => "Switching Protocols", |
| | 0 | 16 | | 102 => "Processing", |
| | 0 | 17 | | 103 => "Early Hints", |
| | 0 | 18 | | |
| | 0 | 19 | | 200 => "OK", |
| | 0 | 20 | | 201 => "Created", |
| | 0 | 21 | | 202 => "Accepted", |
| | 0 | 22 | | 203 => "Non-Authoritative Information", |
| | 0 | 23 | | 204 => "No Content", |
| | 0 | 24 | | 205 => "Reset Content", |
| | 0 | 25 | | 206 => "Partial Content", |
| | 0 | 26 | | 207 => "Multi-Status", |
| | 0 | 27 | | 208 => "Already Reported", |
| | 0 | 28 | | 226 => "IM Used", |
| | 0 | 29 | | |
| | 0 | 30 | | 300 => "Multiple Choices", |
| | 0 | 31 | | 301 => "Moved Permanently", |
| | 0 | 32 | | 302 => "Found", |
| | 0 | 33 | | 303 => "See Other", |
| | 0 | 34 | | 304 => "Not Modified", |
| | 0 | 35 | | 305 => "Use Proxy", |
| | 0 | 36 | | 307 => "Temporary Redirect", |
| | 0 | 37 | | 308 => "Permanent Redirect", |
| | 0 | 38 | | |
| | 0 | 39 | | 400 => "Bad Request", |
| | 0 | 40 | | 401 => "Unauthorized", |
| | 0 | 41 | | 402 => "Payment Required", |
| | 0 | 42 | | 403 => "Forbidden", |
| | 0 | 43 | | 404 => "Not Found", |
| | 0 | 44 | | 405 => "Method Not Allowed", |
| | 0 | 45 | | 406 => "Not Acceptable", |
| | 0 | 46 | | 407 => "Proxy Authentication Required", |
| | 0 | 47 | | 408 => "Request Timeout", |
| | 0 | 48 | | 409 => "Conflict", |
| | 0 | 49 | | 410 => "Gone", |
| | 0 | 50 | | 411 => "Length Required", |
| | 0 | 51 | | 412 => "Precondition Failed", |
| | 0 | 52 | | 413 => "Request Entity Too Large", |
| | 0 | 53 | | 414 => "Request-Uri Too Long", |
| | 0 | 54 | | 415 => "Unsupported Media Type", |
| | 0 | 55 | | 416 => "Requested Range Not Satisfiable", |
| | 0 | 56 | | 417 => "Expectation Failed", |
| | 0 | 57 | | 421 => "Misdirected Request", |
| | 0 | 58 | | 422 => "Unprocessable Entity", |
| | 0 | 59 | | 423 => "Locked", |
| | 0 | 60 | | 424 => "Failed Dependency", |
| | 0 | 61 | | 426 => "Upgrade Required", // RFC 2817 |
| | 0 | 62 | | 428 => "Precondition Required", |
| | 0 | 63 | | 429 => "Too Many Requests", |
| | 0 | 64 | | 431 => "Request Header Fields Too Large", |
| | 0 | 65 | | 451 => "Unavailable For Legal Reasons", |
| | 0 | 66 | | |
| | 0 | 67 | | 500 => "Internal Server Error", |
| | 0 | 68 | | 501 => "Not Implemented", |
| | 0 | 69 | | 502 => "Bad Gateway", |
| | 0 | 70 | | 503 => "Service Unavailable", |
| | 0 | 71 | | 504 => "Gateway Timeout", |
| | 0 | 72 | | 505 => "Http Version Not Supported", |
| | 0 | 73 | | 506 => "Variant Also Negotiates", |
| | 0 | 74 | | 507 => "Insufficient Storage", |
| | 0 | 75 | | 508 => "Loop Detected", |
| | 0 | 76 | | 510 => "Not Extended", |
| | 0 | 77 | | 511 => "Network Authentication Required", |
| | 0 | 78 | | |
| | 0 | 79 | | _ => null, |
| | 0 | 80 | | }; |
| | | 81 | | } |
| | | 82 | | } |