Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reqlib

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
250
decreased by-53.53%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 04 Mar 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc