Skip to content

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

License

Notifications You must be signed in to change notification settings

KhaledNobani/request-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

  • To make quick GET | POST | PUT | DELETE request.
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

  • http / https module - provides HTTP / HTTPS request
  • url-parser - provides utility to parse URL
  • querystring - provides utility to parse querystring

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published