Vue,Axios,向 YouTube 搜索发出获取请求 API return 404
Vue, Axios, making a get request to YouTube search API return 404
不确定我做错了什么。我正在尝试向 YouTube API 发出获取关键字的请求。查询字符串现在返回 404 我已经添加了引用 url 并具有当前的 api 键。
我使用 axios.The 位置进行调用的方法注销正常。
async getYouTubeVideoId(location) {
console.log({ location })
try {
const response = await axios.get(
`https://www.googleapis.com/youtube/v3/search?key="mykeyinquotes"&type=video&part=snippet&maxResults=5&q=${location}`
)
console.log(response.data)
} catch (error) {
console.log({ error })
}
},
这是我调用方法的地方
async created() {
this.getLocationData()
await this.getWikiData(this.pickedLocation.name)
await this.getYouTubeVideoId(this.pickedLocation.name)
this.asyncDataStatus_fetched()
}
API 键不应在引号中。
不确定我做错了什么。我正在尝试向 YouTube API 发出获取关键字的请求。查询字符串现在返回 404 我已经添加了引用 url 并具有当前的 api 键。
我使用 axios.The 位置进行调用的方法注销正常。
async getYouTubeVideoId(location) {
console.log({ location })
try {
const response = await axios.get(
`https://www.googleapis.com/youtube/v3/search?key="mykeyinquotes"&type=video&part=snippet&maxResults=5&q=${location}`
)
console.log(response.data)
} catch (error) {
console.log({ error })
}
},
这是我调用方法的地方
async created() {
this.getLocationData()
await this.getWikiData(this.pickedLocation.name)
await this.getYouTubeVideoId(this.pickedLocation.name)
this.asyncDataStatus_fetched()
}
API 键不应在引号中。