// method OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT function request(dever, url, param, callback, method, header){ if(!method) { method = 'get'; } if (!header) { var header = {}; header['content-type'] = 'application/x-www-form-urlencoded'; } for (var i in dever.config.host) { if (url.indexOf(i + '.') != -1) { url = url.replace(i + '.', dever.config.host[i]); break; } } wx.request({ url: url, data: param, method: method.toUpperCase(), header: header, success: callback.success, fail: callback.fail, complete: callback.complete }) } module.exports = { request:request }