request-http2

0.0.2 • Public • Published

request-http2

Request module with HTTP/2 support

This project is a modified fork of request project. Therefore see request for details.

HTTP/2 requests

Unlike request package, it supports HTTP/2 requests. Just add http: true in the options object argument in request method.

For example, see POST request below -

  var options = {
    method: 'POST',
      uri: 'https://someurl.com/path',
      http2: true,
      headers: {
        // HEADERS go here
      },
      body: {
        // DATA to be posted
      } ,
      json: true
  };
 
  request(options, function (error, response, body) {
    if (error) {
      return console.error('upload failed:', error);
    }
    console.log('Server responded with:', body);
  })

Readme

Keywords

none

Package Sidebar

Install

npm i request-http2

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • code-master5