mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-03-19 05:19:47 +08:00
20 lines
455 B
JavaScript
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);
|
|
|
|
}) |