Files
proxypin/test/js.js
2025-09-12 00:36:22 +08:00

20 lines
455 B
JavaScript

async function onRequest() {
const fetchResponse = await fetch('https://httpbin.org/anything');
console.log(fetchResponse.headers);
console.log(await fetchResponse.text());
console.log( fetchResponse.body);
const response = {
statusCode: 200,
body: fetchResponse.body,
headers: fetchResponse.headers
};
return response;
}
onRequest().then( response => {
console.log('Response:', response);
})