Skip to content

parpeoficial/stackerjs-http

Repository files navigation

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();
  });

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •