Download next.js/packages/next/src/server/web/http.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/web/http.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/server/web/http.ts
-
curl -L -o http.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/web/http.ts
738 Bytes
| /** | |
| * List of valid HTTP methods that can be implemented by Next.js's Custom App | |
| * Routes. | |
| */ | |
| export const HTTP_METHODS = [ | |
| 'GET', | |
| 'HEAD', | |
| 'OPTIONS', | |
| 'POST', | |
| 'PUT', | |
| 'DELETE', | |
| 'PATCH', | |
| ] as const | |
| /** | |
| * A type representing the valid HTTP methods that can be implemented by | |
| * Next.js's Custom App Routes. | |
| */ | |
| export type HTTP_METHOD = (typeof HTTP_METHODS)[number] | |
| /** | |
| * Checks to see if the passed string is an HTTP method. Note that this is case | |
| * sensitive. | |
| * | |
| * @param maybeMethod the string that may be an HTTP method | |
| * @returns true if the string is an HTTP method | |
| */ | |
| export function isHTTPMethod(maybeMethod: string): maybeMethod is HTTP_METHOD { | |
| return HTTP_METHODS.includes(maybeMethod as HTTP_METHOD) | |
| } | |