One-click configuration: Vless Encryption + XHTTP

This commit is contained in:
心隨緣動 2025-09-20 01:32:13 +08:00 committed by GitHub
parent 7ad559f69a
commit dd1e6d4144
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,6 +29,22 @@ class HttpUtil {
return typeof data === 'object' ? data : new Msg(false, 'unknown data:', data);
}
static async postForm(url, data) {
const formData = new URLSearchParams();
for (const key in data) {
formData.append(key, data[key]);
}
const res = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: formData.toString()
});
return res.json();
}
static async get(url, params, options = {}) {
try {
const resp = await axios.get(url, { params, ...options });