javascript - How to get data using fetch API with mode 'no-cors'? -


code looks this, not sure how read response data. idea?.

var url = 'http://www.bbc.co.uk/sport/football';  fetch(url, {   mode : 'no-cors' }).then(function(response) {   console.log(response); }); 

response object

you can't.

if origin doesn't support cors, can't response data directly. that's whole point of no-cors... allowing use response in ways, not read/access data.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -