Socket
Socket
Sign inDemoInstall

hook.io-request

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hook.io-request

a simple Hook for making outgoing http requests


Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

hook.io-request

a simple Hook for making outgoing http requests

Installation

 npm install hook.io-request -g

Usage

 hookio-request

Hook Events Names

http::request sends HTTP request:

http::request::result event emitted when request comes back:

http::request::error event emitted when error comes back:

Example


  //
  // options is a 1:1 mapping to https://github.com/mikeal/request API 
  //
  var options = {
    url: "http://google.com/"
  };
  
  //
  // Make a request with a callback
  //
  //
  hook.emit('http::request', options, function(){
    //console.log('http::request has responded')
  });

Note that the "hook" key contains original parameters passed to request, making it ideal to put some other values for handling the request context (such as linking the request to an id, for example)

FAQs

Package last updated on 20 Sep 2011

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