http://api.douban.com/v2/movie/in_theaters? 这个豆瓣电影API是不是已经挂了,不能使用了???
页面返回数据:
{"msg":"invalid_apikey","code":104,"request":"GET \/v2\/movie\/in_theaters"}
在请求API的url后面跟一个apikey参数:http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10
// 云函数入口函数
exports.main = async (event, context) => {
return rp(`http://api.douban.com/v2/movie/in_theaters?
apikey=0df993c66c0c636e29ecbb5344252a4a
&start=${event.start}&count=${event.count}`)
.then(function (res){
console.log(res);
return res
})
.catch(function (err){
console.err(err);
});
}
https://douban.uieee.com/v2/movie/in_theaters使用https访问就行了