1.

douban:function(){

2.

wx.request({

3.

url:'https://douban.uieee.com/v2/book/1220562',

4.

//必须要设置"content-type":"json",不然会报错400(BadRequest)

5.

header:{

6.

"content-type":"json"

7.

},

8.

success:function(backData){

9.

console.log(backData);

10.

}

11.

})

12.

}

13.

在请求数据时,如果遇到以下问题

14.

这是因为在小程序中发起了wx.request请求,但是请求的域名没有在微信公众平台后台设置(https://blog.csdn.net/hicoldcat/article/details/54288245)

15.

勾上就可以了

TAG标签: 微信小程序使用豆瓣API接口微信小程序api接口调用微信小程序ibeacon

http://www.xiaochengxub.com/read-96260.html