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

client-http

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

client-http

Node client HTTP/HTTPS request wrapper for easy to make client HTTP/HTTPS request

  • 0.0.3
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-client-http: Easy to make client HTTP/HTTPS request

Feature List

  1. Automatic proxy setting, if you set the proxy in your environment variable(http_proxy), it will be auto detected and used in your any HTTP request, also it will be used in your HTTPS request by HTTPS Tunnel(denpency by node-tunnel) to make HTTPS request through HTTP.

  2. Make your HTTP/HTTPS request with cookie, cookie will be automatic processed int any HTTP/HTTPS request and you can get the cookie value in response.

  3. HTTP redirect handling, HTTP redirect(301/302) will be automatic handled in you HTTP/HTTPS request.

Example

var http = require('client-http');

http.get("http://www.google.com/", function(data){
    data && console.log(data);
});

Installation

$ npm install client-http

Usages

HTTPS request

var http = require('client-http');

http.get("https://www.google.com/", function(data){
    data && console.log(data);
});
var http = require('client-http');

http.get("http://www.google.com/", function(data, err, cookie){
    !err && console.log(cookie);
});

HTTP Post

var http = require('client-http');

http.request("http://www.snee.com/xml/crud/posttest.cgi", function(data){
    data && console.log(data);
}, "fname=hello&lname=world");

HTTP request with custom header

var http = require('client-http');

// we use iPhone as our user-agent and see what happen
http.request("http://twitter.com/", function(data){
    data && console.log(data);
}, null, {"User-Agent": "iPhone"});

Keywords

FAQs

Package last updated on 25 Feb 2013

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