如何解决错误:API 请求的结果无法转换为 JSON 对象:
Error:
Uncaught (in promise) GET request to api/endpoint? failed with error:
API request's result could not be converted to a JSON object:
<html>
..some stuff here..
</html>
因此,我向“api/endpoint”发出请求,但出于某种原因,它说 JSON 对象无法转换。然后我去了这个'api/endpoint'并做了console.log(response)(//这是发送到前端的内容)。后端的 console.log 只是 { userId: '..',name: '...'}
我不知道为什么这不能被翻译..?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。