/**
* 测试执行:node ./test.js
*/
var http = require('http')
function post(hostname, path, json_data, callback){
var options = {
hostname: hostname,
port: 80,
path: path,
method: 'POST',
headers: {
'Content-Type':'application/json',
'Date':'Tue, 26 Aug 2025 07:14:23 GMT', // 请替换为当前的GMT时间
'Authorization':'Signature xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', //请替换为您的鉴权签名
}
}
var req = http.request(options, function(res){
var body ="";
res.setEncoding('utf8');
res.on('data', function(chunk){
//console.log(chunk.toString());
body += chunk;
});
res.on('end', function(){
var json = JSON.parse(body);
callback(json)
});
});
req.on('error', function(e){
console.log('msg:'+e.message);
});
req.write(json_data);
req.end();
}
var hostname = "api.ihuyi.com";
var request_uri = "/empty-number/submit";
//定义请求的数据
var values = {
"mobiles":["135xxxxxxxx","136xxxxxxxx"], //手机号数组(最多10个)
}
var json_data = JSON.stringify(values);
//发起请求
post(hostname, request_uri, json_data, function(json){
//打印结果
console.log(json);
})
国内专业互联网团队
21年行业经验
7x24小时售后支持
丰富的行业经验
Copyright © 2004-2025 上海思锐信息技术有限公司 All rights reserved. 沪ICP备07035915号-15 电信增值业务许可证:B2-20160082
服务热线:
4008 808 898
服务热线(工作时间):
4008 808 898
业务咨询(非工作时间):
售后咨询(非工作时间):