1.1.1 • Published 5 years ago

h2-request v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

HTTP2 request

Greenkeeper badge

NPM Version Build Status Known Vulnerabilities

Http2 Request is designed to be the simplest way possible to make http & http2 calls. It supports HTTP2 and follows redirects by default.

To be http2 compatible it uses http2-client. To make requests it uses request - expect the API to be identical just with http2 support.

API

The API is identical to that of request as this module just changes the http modules of request - you will actually be using request. The only addition to the API is to disable this module behavior on request basis

const request = require('h2-request');
request({
  uri : 'http://www.google.com',
  disableHttp2 : true // <-- Now it's a regular request without http2
}, function (error, response, body) {
  console.log('error:', error); // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
  console.log('body:', body); // Print the HTML for the Google homepage.
});

Full API Documentation

To see the full API documentation: request Documentation

License

MIT

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago