我正在尝试获取服务器的get请求,但一直收到CORS错误,我对https请求的了解不是很深,但这就是我的错误:
exit()
binSize=1h&symbol=XBT&count=10&startTime=2019-01-26&endTime=2019-01-27 403
Access to fetch at 'https://www.bitmex.com/api/v1/trade/bucketed?binSize=1h&symbol=XBT&count=10&startTime=2019-01-26&endTime=2019-01-27' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
我已经尝试了下面的代码,但是我不太确定如何修改它,并且关于响应和这种特定类型的调用没有很多文档,我不喜欢这种方法,看起来好像更好选择可以获取数据的任何方法就足够了。
这是我目前拥有的:
Uncaught (in promise) TypeError: Failed to fetch
}
到目前为止没有运气,但接受建议!