One-click configuration: Vless Encryption + XHTTP
This commit is contained in:
parent
7ad559f69a
commit
dd1e6d4144
@ -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 });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user