結果是null
options:
{ uri: 'http://api.douban.com/v2/movie/in_theaters?start=undefined\n ?&count=undefined',
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false },
這是云控制臺的信息,路徑上我是這么配置的,
`http://api.douban.com/v2/movie/in_theaters?start=${event.start}
?&count=${event.count}`
但是日志中start和count都是沒有定義,而且兩個參數之間多了\n占位符,這是什么原因?
2019-05-30
由于最近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的URL中間不要敲回車,你這個問題應該是中間敲了回車導致的。