http-method-enum
HTTP methods as a TypeScript enum.
Install
$ npm install http-method-enum
Usage
Node.js / CommonJS:
ESNext / TypeScript:
if res.method = HTTPMethod.GET
All current standard HTTP methods are available as follows:
- CONNECT = 'CONNECT'
- DELETE = 'DELETE'
- GET = 'GET'
- HEAD = 'HEAD'
- OPTIONS = 'OPTIONS'
- PATCH = 'PATCH'
- POST = 'POST'
- PUT = 'PUT'
- TRACE = 'TRACE'
Related
News and Updates
Follow @typeslick on Twitter for the latest updates and new project announcements.