Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A wrapper that chooses http or https for requests
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README.md
http-https.js
package.json
test.js

README.md

http-https

A wrapper that chooses http or https for requests

USAGE

var hh = require('http-https')

var req = hh.request('http://example.com/bar')
var secureReq = hh.request('https://secure.example.com/foo')

// or with a parsed object...
var opt = url.parse(someUrlMaybeHttpMaybeHttps)
opt.headers = {
  'user-agent': 'flergy mc flerg'
}
opt.method = 'HEAD'
var req = hh.request(opt, function (res) {
  console.log('got response!', res.statusCode, res.headers)
})
req.end()
Something went wrong with that request. Please try again.