提交 e7e76220 编写于 作者: Q qq_41923622

Mon Feb 10 16:33:00 CST 2025 inscode

上级 b46d6453
const axios = require('axios');
const querystring = require('querystring');
var headersData = {
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9",
Connection: "keep-alive",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
Host: "h5.hunlihu.com",
Origin: "https://s.hunlihu.com",
Referer: "https://s.hunlihu.com/",
"sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "Windows",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-site",
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36",
};
let formData = {
'auth': 'Lz8rzL8zzt',
'jsons': `[{"d_name":"five123","user_agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36","msg_type":"1","openid":"","nickname":"哈哈1","headimgurl":"","d_else":"新婚快乐 百年好合"}]`
}
// 目标服务器地址和端口
const options = {
//
hostname: 'https://h5.hunlihu.com',
path: '/vashow/ly/door/door/sign2',
method: 'POST',
headers: headersData
};
let url= "https://h5.hunlihu.com/vashow/ly/door/door/sign2";
// 将对象格式的数据转换为 x-www-form-urlencoded 格式
const encodedData = querystring.stringify(formData);
// 更新请求头中的 Content-Length
options.headers['Content-Length'] = Buffer.byteLength(encodedData);
axios.post(url, encodedData, { headers:options.headers })
.then(response => {
console.log('请求成功,响应数据:', response.data);
}).catch((err)=>{
})
......@@ -12,11 +12,13 @@
"license": "ISC",
"dependencies": {
"@types/node": "^18.0.6",
"axios": "^1.7.9",
"body-parser": "^1.20.3",
"express": "^4.21.2",
"form-data": "^4.0.1",
"http-proxy-middleware": "^3.0.3",
"node-fetch": "^3.2.6",
"querystring": "^0.2.1",
"request": "^2.88.2"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册