Object containing all supported HTTP methods as key-value pairs.
Each property name is the HTTP method name, and each value is the same
string. This provides both a constant reference and a way to iterate
over all supported methods.
Usage: Use these constants instead of string literals to prevent
typos and ensure consistency across your codebase.
Example
// ✅ Good - use constants if (method === HTTP_METHODS.GET) { // Handle GET request }
// ❌ Bad - string literals can have typos if (method === 'GET') { // Handle GET request }
// Iterate over all methods for (const [name, value] ofObject.entries(HTTP_METHODS)) { console.log(`${name}: ${value}`); }
Object containing all supported HTTP methods as key-value pairs.
Each property name is the HTTP method name, and each value is the same string. This provides both a constant reference and a way to iterate over all supported methods.
Usage: Use these constants instead of string literals to prevent typos and ensure consistency across your codebase.