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

http-retry

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-retry

HTTP retry module

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

vlerdas-http-retry

Module to submit an HTTP request with configurable retry logic for failed attempts

Installation

npm install http-retry

Current Status

This module is currently under development

Tutorial

Input

{
    "reqOptions":  url || {options object},
    "successCodes": [],
    "failureNoRetryCodes": [],
    "retry" : {}
}
Parameters
  • reqOptions - request options as defined in https://github.com/mikeal/request
  • successCodes - an array of http response codes identified by calling function as the only codes considered successful; requests, for which the codes are returned, will NOT be retried
  • failureNoRetryCodes - an array of http response codes identified by calling function as failure codes for which NO retries will be attempted
  • retry - retry options as defined in https://github.com/tim-kos/node-retry

Output

{
    "response": {http.IncomingMessage object},
    "body": {response body},
    "retryFailure" : true | false
}
Parameters
  • response - response statusCode, headers, etc.
  • body - response body
  • retryFailure - set to true if retry attempts failed; default is false

Usage


var options = {
    "reqOptions": {
        url: 'http://localhost:3001/ecrud/v1/core/electronicCaseFiles?query=%7B%22case:ElectronicCaseFile.case:CommonData.nc:Person.nc:PersonSSNIdentification.nc:IdentificationID%22:%22333428888%22%7D&sort=%7B%22$natural%22:-1%7D&limit=1',
        method: 'GET'
    },
    successCodes: [200],
    failureNoRetryCodes: [404, 405],
    "retry" : {
        "retries" : 2,
        "factor" : 3,
        "minTimeout" : 1000,
        "maxTimeout" : 60000,
        "randomize" : true
    }
};




Created with Nodeclipse (Eclipse Marketplace, site)

Nodeclipse is free open-source project that grows with your contributions.

http-retry

module to submit an HTTP request with configurable retry logic for failed attempts

Keywords

FAQs

Package last updated on 09 Apr 2014

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