var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "text": "I like the ocean and the smell of rain" }); var requestOptions = { method: 'GET', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://fragrance-rec.herokuapp.com/api/v1", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));