Using Got - Lightweight HTTP request library for Node.js
const got = require('got');
const response = await got.post('http://qrcode.show/', {
body: 'This is Nodejs',
});
const got = require('got');
const response = await got.post('http://qrcode.show/', {
body: 'This is Nodejs',
headers:{
'X-QR-Width': '50',
'X-QR-Height': '50'
}
});
console.log(response.body);
const got = require('got');
const fs = require('fs');
const response = await got.post('http://qrcode.show/',{
body: 'This is Nodejs',
headers:{
accept:'image/png'
}
});
fs.writeFileSync('qrcode.png',response.rawBody)