求大神给一份封装wx.request的代码 自己写的感觉都不对啊

发布于 8 年前作者 qfan2744 次浏览最后编辑 8 年前来自 ask

求大神给一份封装wx.request的代码 

2 回复
chou
chou1 楼6 年前
wx.request({
            url: localhost,
            data: {
                id: id
            },
            header: {
                'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
            },
            method: 'POST',
            dataType: 'json',
            responseType: 'text',
            success: function (res) {
                 
            }
        })

同新人,一起加油