Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isaacs/http-https
A wrapper that chooses http or https for requests
https://github.com/isaacs/http-https
Last synced: 7 days ago
JSON representation
A wrapper that chooses http or https for requests
- Host: GitHub
- URL: https://github.com/isaacs/http-https
- Owner: isaacs
- License: isc
- Created: 2014-01-02T05:29:28.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2022-02-26T23:00:22.000Z (over 2 years ago)
- Last Synced: 2024-10-19T21:24:48.512Z (15 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 18
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http-https
A wrapper that chooses http or https for requests
## USAGE
```javascript
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()
```