1.3.0 • Published 6 years ago
http-header-fields-typed v1.3.0
http-header-fields-typed
Collect them all HTTP header fields definitions, including common non-standard ones.
Installation
npm
npm install --save http-header-fields-typed
yarn
yarn add http-header-fields-typed
Usage
TypeScript
import HttpHeaderFields from "http-header-fields-typed";
console.log(HttpHeaderFields.CONTENT_LENGTH);
// Example for how to set a header using the definitions ...
res.writeHead(HttpStatus.INTERNAL_SERVER_ERROR, {
[HttpHeaderFields.CONTENT_TYPE]: "text/plain",
});
JavaScript
var HttpHeaderFields = require('http-header-fields-typed').default;
console.log(HttpHeaderFields.CONTENT_LENGTH);