我正在尝试查看 IMDB 中的所有电影。我不愿意这么做。因此,我决定使用一个搜索栏,它将发送电影名称的字符串,然后显示该字符串的电影。但即使我生成了密钥,它也会给我错误。
这是片段,请帮忙!
axios.get('http://www.omdbapi.com/?i=tt3896198&apikey=5657bf65'+searchText)
我在代码中做错了什么?
如果可能的话,请告诉我从最近开始查看 IMDB 中所有电影的代码,无需任何搜索查询。
我不认为 omdbapi 可以选择显示所有视频,但是对于搜索,您可以这样使用它:
axios.get('http://www.omdbapi.com/?apikey=5657bf65&s='+searchText)
据我所知,您正在使用搜索 API,但调用不正确。
像这样通过&搜索
axios.get(http://www.omdbapi.com/?i=tt3896198&apikey=5657bf65&search=searchText)
你需要像这样传递你搜索到的电影名称
axios.get(`http://www.omdbapi.com/?i=tt3896198&apikey=5657bf65&search=${pass searched movie name}`);