axios protobuf 通讯

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 通讯)