0.0.2 • Published 8 years ago
request-http2 v0.0.2
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);
  })