nodejs 模拟https post 的form 请求


var request = require( 'request');


request. post(
{
url: 'https://XXXXXXXXXXXXXXXXXXXXXXXXXX',
form:{
rawtx:rawtx
},
encoding: 'utf8'
}, function( error, response, body){
if(! body[ 'txid']){
return callback( new Error( body. toString()));
}
var ret= JSON. parse( html);
return callback( null, ret);
}
);

猜你喜欢

转载自blog.csdn.net/changliangwl/article/details/80241087