@asmodeo/http
v1.0.4
Published
This library contains utilities relations to queries requests to the server.
Downloads
13
Readme
@asmodeo
This library contains some reusable code blocks for different applications.
@asmodeo/http
How to install:
npm i @asmodeo/http
npm i @asmodeo/http --save
enum: STATUS_CODE
Contains the status code values.
Example:
import { STATUS_CODE } from '@asmodeo/http';
console.log(STATUS_CODE.OK); // 200
console.log(STATUS_CODE.ACCEPTED); // 202
console.log(STATUS_CODE.UNAUTHORIZED); // 401
console.log(STATUS_CODE.INTERNAL_SERVER_ERROR); // 500
model: StatusCode
Contains the status code validations and object instantiate.
Example:
import { StatusCode } from '@asmodeo/http';
const _statusCode_ = new StatusCode(200);
console.log(_statusCode_.value); // 200
console.log(_statusCode_.ok); // true
console.log(_statusCode_.continue); // false
// ...
console.log(StatusCode.isBadRequest(200)); // false
console.log(StatusCode.isBadRequest(400)); // true