方法1
var aaa= urlBase64ToUint8Array(encrypt);
var bb=new Uint8Array(aaa)
var xhr = new XMLHttpRequest;
xhr.open("POST", "http://localhost:1111/XXXX", false);
xhr.send(bb);
xhr.onreadystatechange= function() {
alert("returned:"+ xhr.responseText);
}
方法2 微信小程序
var data=stringtobyte.urlBase64ToUint8Array(encrypt)
app.wxPRequest(
'POST',url,data.buffer,(data)=>{
wx.hideLoading({
success: (res) => {},
})
responseType:'arraybuffer',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
网友评论