# http.js
```
import utils from "../../utils/utils"
var http = utils.http;
const douban = "https://douban.uieee.com/v2/movie/";
onLoad:function(options){
var self = this;
var count = "?start=0&count=3";
var inTheaters = douban+"in_theaters"+ count;
var comingSoon = douban + "coming_soon" + count;
var top250 = douban + "top250" + count;
http(inTheaters, this.handleData,"in_theaters")
http(comingSoon, this.handleData,"coming_soon")
http(top250,this.handleData,"top250")
},
```
# utils
```
function http(url,callback,type){
wx.request({
url,
header:{
'Content-type':'json'
},
success:function(res){
callback(res,type)
}
});
}
```