繁体   English   中英

Ajax通过API向HTTPS请求的问题

[英]Problems with Ajax request to HTTPS over API

我正在尝试通过Heroku部署我的第一个React应用程序。 在本地环境中运行时,它可以很好地工作,但是当我部署它时,无法完成对Movie DB API的请求,并出现以下错误:

The page at 'https://boiling-escarpment-83243.herokuapp.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.themoviedb.org/3/genre/list?api_key='. This content should also be served over HTTPS.

{"status_code":7,"status_message":"Invalid API key: You must be granted a valid key."}

同样,本地的API密钥也没有问题。 我最初使用的包中的base_uri指向http URL,但我将其更新为https(并测试了https路由,并且似乎受支持: https : //api.themoviedb.org/3/movie/550 )。 这是我无法使用的应用程序: https : //boiling-escarpment-83243.herokuapp.com/

愚蠢的问题:您是否将请求URL更新为https://api.themoviedb.org/3/movie/550 看起来请求仍然是http://api.themoviedb.org/3/movie/550

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM