小游戏 appid:
wx7a5b9e98b5ed7570
代码如下:
var body = '';
const req = https.request({
hostname: 'api.weixin.qq.com',
method: 'POST',
path: '/wxa/img_sec_check?access_token=' + access_token,
headers: {
"content-type": "multipart/form-data; boundary=" + pdata.boundary,
'Content-Length': Buffer.byteLength(pdata.data)
},
}, (res) => {
res.on('data', function (d) {
body += d;
})
res.on('end', function () {
console.log(body);
})
});
req.on('error', (e) => {
console.log(e);
});
req.write(pdata.data);
req.end();
var formData = function (param) {
var max = 9007199254740992;
var dec = Math.random() * max;
var hex = dec.toString(36);
var boundary = '---------------------------kkjk' + hex;
var data = '--' + boundary + "\r\n";
var filedata = '';
filedata += param.res.headers['content-disposition'] + "\"\r\n";
filedata += "content-type: " + param.res.headers['content-type'] + "\r\n\r\n";
filedata += param.media + "\r\n";
filedata += '--' + boundary + "\r\n";
data += filedata + "--\r\n\r\n";
return {
data,
boundary
};
}
帖子已经隐藏了,图片麻烦也提供下
用导人图片试试