EDIT CODE

Job ID: 33478517

Budget: $10 – $30 USD

I need a javascript code edited it is currently in the GET request method i need it to be POST method sample of code below

addEventListener('fetch', function (event) {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
// Only GET requests work with this proxy.
if (request.method !== 'GET') return MethodNotAllowed(request);
return fetch(`https://example.com`);
}
function MethodNotAllowed(request) {
return new Response(`Method ${request.method} not allowed.`, {
status: 405,
headers: {
Allow: 'GET',
},
});
}