stackerjs-http
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

Travis Test Coverage Maintainability dependencies Status npm

NPM

StackerJS

Http

Package for managing Http requests and responses in and outside StackerJS

Usage

Response

import { Http } from "stackerjs-http";
 
let httpResponse = new Http.Response();
 
httpResponse.setContent({ status: true });
httpResponse.setContent("Everything is ok"); // or
httpResponse.setContent(new Buffer("Something")); // or
 
httpResponse.setStatusCode(200);

MakeRequest

new Http.MakeRequest()
  .setPort(3000)
  .setHeader("Authorization", "Bearer some-token")
  .get("/v1/some/api", { limit: 10 }) // same for post(), put(), delete() or patch()
  .then(httpResponse => {
    // instance of Http.Response
    let content = httpResponse.getContent();
  });

Readme

Keywords

none

Package Sidebar

Install

npm i stackerjs-http

Weekly Downloads

1

Version

1.2.2

License

none

Unpacked Size

213 kB

Total Files

15

Last publish

Collaborators

  • parpeoficial