Skip to content

Instantly share code, notes, and snippets.

@stormoz
stormoz / axios_get_pipe_zip.js
Created July 25, 2019 13:29 — forked from bhuizi/axios_get_pipe_zip.js
axios get request w/ piping
const axios = require('axios');
const fs = require('fs');
const url = <path_to_file>
axios({
method: 'get',
url: url,
responseType:'stream'
})
.then(res => {
res.data.pipe(fs.createWriteStream('new.zip'));
{
"_links": {
"self": { "href": "/orders" },
"next": { "href": "/orders?page=2" },
"find": { "href": "/orders{?id}", "templated": true }
},
"_embedded": {
"orders": [{
"_links": {
"self": { "href": "/orders/123" },