axios protobuf 通讯
作者:
yaoyilmm | 来源:发表于
2021-12-23 10:43 被阅读0次let obj = 'sssssss'
let data = {
address: '0xb3c734cECCf6eE67',
signature:'obj',
message:'I am signing my :'
}
let req = protoRoot.lookup("VerifySignatureReq").encode(data);
console.log("encode===" + req.finish().length);
let blob = new Blob([req.finish()], {type: 'buffer'});
axios.post('/api/login/verifySignature', blob,{headers: {
'Content-Type': 'application/x-jprotobuf;charset=UTF-8'
}}).then(function(response) {
console.log(response.data);
console.log(response.status);
console.log(response.statusText);
console.log(response.headers);
console.log(response.config);
});
}
}
本文标题:axios protobuf 通讯
本文链接:https://www.haomeiwen.com/subject/qrjlqrtx.html
网友评论