0.0.2 • Published 6 months ago

@nodifier/postman v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

@nodifier/postman

Wrap functionality the native nodejs request module to support async await

How to use?

You can import the module to your code as follows:

import { request } from "@nodify/postman";

request

  • General example

import { request } from "@nodify/postman";

const result = await request(
      "http://test.local/v1/service", // Request endpoint
      cut.Method.post, // Request method
      {}, // Request headers
      JSON.stringify({
        test: "test",
      }) // Request payload
    );
  • Making compressed example (using gzip)
import { request } from "@nodify/postman";

const result = await request(
      "http://test.local/v1/service", // Request endpoint
      cut.Method.post, // Request method
      {
        "accept-encoding": "gzip"
      }, // Request headers
      JSON.stringify({
        test: "test",
      }) // Request payload
    );
0.0.2

6 months ago

0.0.1

6 months ago