using of fetch API the unexpected end of input error occurr

一个人想着一个人 提交于 2019-12-02 09:54:27

You said mode:'no-cors', so fetch doesn't attempt to read data across origins (which is forbidden by default), and it doesn't throw an error (because you told it you didn't want to try to read data across origins).

Change it to mode: "cors".

Ensure the server you are requesting the data from grants you permission to read the response using the Access-Control-Allow-Origin header.


See also this answer about the Same Origin Policy.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!