Http request info

Peter_34

New member
const fetch = require('node-fetch');

const url = 'https://play.ht/api/v2/tts/stream';
const options = {
method: 'POST',
headers: {
accept: 'audio/mpeg',
'content-type': 'application/json',
AUTHORIZATION: 'Bearer YOUR_SECRET_KEY_HERE',
'X-USER-ID': 'YOUR_USER_ID_HERE'
},
body: JSON.stringify({
text: 'Hey there, I am calling in regards to the car you enquired yesterday."',
voice: 'larry'
quality: 'draft',
output_format: 'mp3'
})
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));


I wan to make http request of above nodejs in macrodroid, but it gives some errors.
Please someone tells me how do I fill above data in http request of macrodroid
 
Top