#StackBounty: #javascript #node.js #axios #node-streams Piping requests using gaxios (or axios)

Bounty: 50

At present I’m performing the trick of piping a request req to a destination url, and piping the response to res, like so:

const request = require('request');

const destination = request('http://some.url.com');

// pipe req to destination...
const readableA = req.pipe(destination);
readableA.on('end', function () {
    // do optional stuff on end

// pipe response to res...
const readableB = readableA.pipe(res);
readableB.on('end', function () {
    // do optional stuff on end

Since request is now officially deprecated (boo hoo), is this trick at all possible using the gaxios library? I thought that setting responseType: 'stream' on the request would do something similar as above, but it doesn’t seem to work.

SImilarly, can gaxios be used in the following context:

.on('error', function(err) {
.on('entry', myEntryHandlerFunction);

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.