DEV Community

Discussion on: Using Fetch API to Get and Post

Collapse
 
dtsiridakis profile image
dtsiridakis

Nice post !

Trying to fetch HTML data with fetch() method is possible?

I am facing some issues with cors
And I can’t fetch HTML data back.

Collapse
 
devamaz profile image
Ahmad Abdulaziz • Edited

fetch accept URL not sure how you want to fetch HTML for more understanding visit the links in the above comment

Collapse
 
justsml profile image
Daniel Levy

I know this is a bit late of a response, but for anyone interested you can get any string data response via response.text() similar to how response.json() will give you a parsed JSON object.

Collapse
 
silasonyango93 profile image
silasonyango93

Cors is an issue with the api itself and not the front-end.

For more information : daveceddia.com/access-control-allo...