Socket
Socket
Sign inDemoInstall

reqlib

Package Overview
Dependencies
3
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    reqlib

A library to simplify REST API requests and to provide utilities for handling common REST API consumer scenarios


Version published
Maintainers
1
Created

Readme

Source

Simple Request Library

Build Status Coverage Status

Request Constructor

new Request(options)

import { Request } from 'reqlib';

const
  options = {
    maxRedirectCount : 5, // # of redirects to follow
    maxRetryCount : 3, // # of times to retry in the event of a 5xx
    timeout : 1000 // milliseconds
  },
  req = new Request(options);

(async () => {
  try {
    let result = await req.get('https://test.api.io/v1/tests');
    console.log(result);
  } catch (ex) {
    console.error(ex);
  }
})();
options

The Request object accepts all otions from the standard http.request (and https.request) object (see Node v10.x Documentation) in addition to a few additional convenient options.

#delete

#get

#head

#patch

#post

#put

Resource Constructor

under construction

Keywords

FAQs

Last updated on 22 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc