Fill out http codes object
This commit is contained in:
@@ -11,33 +11,66 @@ type CodeDefinitions = {
|
|||||||
[K: string]: HttpCode;
|
[K: string]: HttpCode;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
// FIXME: Figure out how to brand CodeDefinitions in a way that isn't
|
|
||||||
// tedious.
|
|
||||||
|
|
||||||
|
// tx claude https://claude.ai/share/344fc7bd-5321-4763-af2f-b82275e9f865
|
||||||
const httpCodes: CodeDefinitions = {
|
const httpCodes: CodeDefinitions = {
|
||||||
success: {
|
success: {
|
||||||
OK: { code: 200, name: "OK", description: "" },
|
OK: { code: 200, name: "OK", description: "" },
|
||||||
Created: { code: 201, name: "Created" },
|
Created: { code: 201, name: "Created" },
|
||||||
Accepted: { code: 202, name: "Accepted" },
|
Accepted: { code: 202, name: "Accepted" },
|
||||||
NoContent: { code: 204, name: "No content" },
|
NonAuthoritativeInformation: {
|
||||||
|
code: 203,
|
||||||
|
name: "Non-Authoritative Information",
|
||||||
|
},
|
||||||
|
NoContent: { code: 204, name: "No Content" },
|
||||||
|
ResetContent: { code: 205, name: "Reset Content" },
|
||||||
|
PartialContent: { code: 206, name: "Partial Content" },
|
||||||
},
|
},
|
||||||
redirection: {
|
redirection: {
|
||||||
// later
|
MultipleChoices: { code: 300, name: "Multiple Choices" },
|
||||||
|
MovedPermanently: { code: 301, name: "Moved Permanently" },
|
||||||
|
Found: { code: 302, name: "Found" },
|
||||||
|
SeeOther: { code: 303, name: "See Other" },
|
||||||
|
NotModified: { code: 304, name: "Not Modified" },
|
||||||
|
TemporaryRedirect: { code: 307, name: "Temporary Redirect" },
|
||||||
|
PermanentRedirect: { code: 308, name: "Permanent Redirect" },
|
||||||
},
|
},
|
||||||
clientErrors: {
|
clientErrors: {
|
||||||
BadRequest: { code: 400, name: "Bad Request" },
|
BadRequest: { code: 400, name: "Bad Request" },
|
||||||
Unauthorized: { code: 401, name: "Unauthorized" },
|
Unauthorized: { code: 401, name: "Unauthorized" },
|
||||||
|
PaymentRequired: { code: 402, name: "Payment Required" },
|
||||||
Forbidden: { code: 403, name: "Forbidden" },
|
Forbidden: { code: 403, name: "Forbidden" },
|
||||||
NotFound: { code: 404, name: "Not Found" },
|
NotFound: { code: 404, name: "Not Found" },
|
||||||
MethodNotAllowed: { code: 405, name: "Method Not Allowed" },
|
MethodNotAllowed: { code: 405, name: "Method Not Allowed" },
|
||||||
NotAcceptable: { code: 406, name: "Not Acceptable" },
|
NotAcceptable: { code: 406, name: "Not Acceptable" },
|
||||||
// More later
|
ProxyAuthenticationRequired: {
|
||||||
|
code: 407,
|
||||||
|
name: "Proxy Authentication Required",
|
||||||
|
},
|
||||||
|
RequestTimeout: { code: 408, name: "Request Timeout" },
|
||||||
|
Conflict: { code: 409, name: "Conflict" },
|
||||||
|
Gone: { code: 410, name: "Gone" },
|
||||||
|
LengthRequired: { code: 411, name: "Length Required" },
|
||||||
|
PreconditionFailed: { code: 412, name: "Precondition Failed" },
|
||||||
|
PayloadTooLarge: { code: 413, name: "Payload Too Large" },
|
||||||
|
URITooLong: { code: 414, name: "URI Too Long" },
|
||||||
|
UnsupportedMediaType: { code: 415, name: "Unsupported Media Type" },
|
||||||
|
RangeNotSatisfiable: { code: 416, name: "Range Not Satisfiable" },
|
||||||
|
ExpectationFailed: { code: 417, name: "Expectation Failed" },
|
||||||
|
ImATeapot: { code: 418, name: "I'm a teapot" },
|
||||||
|
UnprocessableEntity: { code: 422, name: "Unprocessable Entity" },
|
||||||
|
TooManyRequests: { code: 429, name: "Too Many Requests" },
|
||||||
},
|
},
|
||||||
serverErrors: {
|
serverErrors: {
|
||||||
InternalServerError: { code: 500, name: "Internal Server Error" },
|
InternalServerError: { code: 500, name: "Internal Server Error" },
|
||||||
NotImplemented: { code: 500, name: "Not implemented" },
|
NotImplemented: { code: 501, name: "Not Implemented" },
|
||||||
// more later
|
BadGateway: { code: 502, name: "Bad Gateway" },
|
||||||
|
ServiceUnavailable: { code: 503, name: "Service Unavailable" },
|
||||||
|
GatewayTimeout: { code: 504, name: "Gateway Timeout" },
|
||||||
|
HTTPVersionNotSupported: {
|
||||||
|
code: 505,
|
||||||
|
name: "HTTP Version Not Supported",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export { httpCodes };
|
export { httpCodes };
|
||||||
|
|||||||
Reference in New Issue
Block a user