From e7e7622013c2d756f4cac2979d8ef95f9f9c41e9 Mon Sep 17 00:00:00 2001 From: qq_41923622 Date: Mon, 10 Feb 2025 16:33:00 +0800 Subject: [PATCH] Mon Feb 10 16:33:00 CST 2025 inscode --- index.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 ++ 2 files changed, 51 insertions(+) diff --git a/index.js b/index.js index e69de29..4b212b9 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,49 @@ +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)=>{ + + }) + + diff --git a/package.json b/package.json index e55eae9..e019ce3 100644 --- a/package.json +++ b/package.json @@ -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" } } -- GitLab