When I try to make a POST request from postman to a cloudflare worker, the worker treats the request I am making as a GET request and therefore the information I send through POST is also not arriving in the request.
Example:
Client request
const init = {
method: ‘POST’,
headers: headers,
body: content
}
const response = await fetch(‘https://example.com’, init)
Worker Script
async function handleRequest(event) {
return new Response(event.request.method, { status: 200 })
// Show GET method instead POST method
}
addEventListener(‘fetch’, (event) => {
event.respondWith(handleRequest(event));
});