@khalednobani/request-lib

Leap Day is a theme for GitHub Pages.

@khalednobani/request-lib

The package for making HTTP / HTTPS request into the endpoint.

npm version build status

Docs

Check the documentation

Installation

Install the module with npm

$ npm install -D request-lib

Usage

const REQUEST_LIB = require('request-lib');

REQUEST_LIB.get({
    url: '{endpoint}',
    params: {
      "page": 1,
      "limit": 10
    },
    headers: {
      "authorization": "bearer {access_token}"
    }
})
    .then((response) => {
        /* The response as response text (UTF-8) */
        console.log(response.response_text);
    }).catch((error) => {
        /* Logs the error for further debugging */
        console.log(error);
    });

Proejct structure

The tree structure

├── docs
│   └── how-to-use.md
├── examples
│   └── make-local-request.js
├── libs
│   └── Request.js
├── src/
│   └── svg
│       ├── buld-status.svg
│       ├── npm.svg
│   └── Request.js
├── _config.yml
├── .gitignore
├── index.js
├── LICENSE
├── package.json
├── README.md

Dependencies

Support & Help

Privacy

This module does NOT collect and send any user data. All the operations on the module are done locally on the execution time.

License

MIT License