Help fetching text from an Api

I’m not getting anything in return from the fetch.

Here’s the url I’m trying to fetch from: http://labs.bible.org/api/?passage=John+3:16-17
Here’s the code I’m using:
fetch(’ http://labs.bible.org/api/?passage=John+3:16-17 ', {method: ‘get’})
.then(httpResponse => httpResponse.text())
.then(text => console.log(text));

Any help would be appreciated.

Hi,

Two things to take into consideration:

  1. Change the url to be ‘https’ instead of ‘http’.
  2. Make the API call through a backend module - see here an example to API call.

Hope this helps,

Liran.

Thanks man, I’ll give it a go.