Essential HTTP utilities for TypeScript, including types for HTTP methods, status codes, and headers.
npm install @alwatr/http-primer
import {HttpMethods} from '@alwatr/http-primer';
const method = HttpMethods.GET;
import {HttpStatusCodes} from '@alwatr/http-primer';
const statusCode = HttpStatusCodes.Success_200_OK;
import {HttpRequestHeaders, HttpResponseHeaders} from '@alwatr/http-primer';
const requestHeaders: HttpRequestHeaders = {
accept: 'application/json',
authorization: 'Bearer my-token',
};
const responseHeaders: HttpResponseHeaders = {
'content-type': 'application/json',
'content-length': 1234,
};
import {MimeTypes} from '@alwatr/http-essentials';
const contentType = MimeTypes.JSON; // 'application/json'
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
Contributions are welcome! Please read our contribution guidelines before submitting a pull request.
This project is licensed under the AGPL-3.0 License.