Nero Punished Miscreants

    reqlib

    1.0.13 • Public • Published

    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

    Install

    npm i reqlib

    DownloadsWeekly Downloads

    719

    Version

    1.0.13

    License

    MIT

    Unpacked Size

    95.1 kB

    Total Files

    8

    Last publish

    Collaborators

    • brozeph