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

n-http

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n-http

node-http.

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-94.87%
Maintainers
0
Weekly downloads
 
Created
Source

node-http

Unify http interface in Node.

Installation

npm install node-http

API

var NodeHttp = require('node-http');
var nodeHttp = new Http;
.url(String address)
.header(String name, String value)
.data(Mix data)
.method(String name)
.on(String event, Function callback)
.off(String event, Function callback)
.complete(Function callback)
.success(Function callback)
.fail(Function callback)
.GET(String address, [Function onComplete], [Function onError])
.POST(String address, Mix data, [Function onComplete], [Function onError])
.request(Object options, [Function onComplete], [Function onError])

Events

'complete'
'success'
'fail'
'buffer'
nodeHttp.on('buffer', function (buffer) {

});
status code
nodeHttp.on(200, function (response) {
  
});
status name
nodeHttp.on('Ok', function (response) {

});

nodeHttp.on('Not Found', function (response) {

});

Todo

  • parse charset from html and content-type header

License

MIT

Keywords

FAQs

Package last updated on 03 Nov 2024

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