weixin_慕仔1107782
2019-08-31 18:18
api具体怎么写的呢
豆瓣API有变化,需要在请求API的url后面跟一个apikey参数:
电影列表API:http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10
电影详情API:`http://api.douban.com/v2/movie/subject/${event.movieid}?apikey=0df993c66c0c636e29ecbb5344252a4a`
参考了别人给的豆瓣API exports.main = async (event, context) => {console.log(`start is ${event.start}, count is ${event.count}`)var url = `http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=${event.start}&count=${event.count}`console.log(url)return rp(url).then(function (res) {return res}).catch(function (err) {console.err(err)});}
轻松入门微信小程序与云开发
64581 学习 · 1742 问题
相似问题