Something went wrong. Try again.
Natural language virtual assistant using Node.js + Bootstrap
Something went wrong. Try again.
1234567891011121314151617181920212223const fetch = require('node-fetch');
async function request(options) { if (typeof options === 'string') { options = { uri: options, }; }
const result = await fetch(options.uri || options.url, { ...(options.headers ? options.headers : {}), }); const text = await result.text(); if (!result.ok) { throw new Error(text); } return { body: text, };}
module.exports = request;