簡體   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