Socket
Socket
Sign inDemoInstall

good-request

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    good-request

A highly-simple request package, featuring automatic retries if a request fails.


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Install size
10.9 kB
Created
Weekly downloads
 

Readme

Source

good-request

A highly-simple request package, featuring automatic retries if a request fails. Based on the 2020-07-31 example documented at https://nodejs.org/api/http.html#http_http_request_options_callback .

Versions

  • 1.2.0, 2020-09-15, AMV : Added good-string-sort...
  • 1.1.0, 2020-09-15, AMV : I added more, yet to document...
  • 1.0.1, 2020-08-17, AMV : First publish.

Usage

const goodRequest = require('good-request');
// Functions provided:
goodRequest.basicPost         (urlString, ct,  reqText,               callback)
goodRequest.retryingPost      (urlString, ct,  reqText,    nRetries,  callback)
goodRequest.retryingJsonPost  (urlString,      reqObject,  nRetries,  callback)

callback provides an object with some of the following properties:

res.received:       true | undefined
res.statusCode:     response status integer | undefined
res.text:           response body string | undefined
res.error:          error object | undefined
res.errorsRetried:  array of error objects | undefined
res.object:         response body jso | undefined

Better to just peek at the code.

Keywords

FAQs

Last updated on 15 Sep 2020

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