Handle webhook requests

I am trying to set up a simple worker which will receive a webhook request and pass the data onto my slack API.

For some reason I cannot get this to work, the request.body is always null, thus I can’t handle the data coming in from the webhook

I have tried sending the data over using postman and it remains null, regardless how I send it.

What is interesting is this forms part of the request message I am getting


Anyone got any tips, I have tried googling but not having any luck.

I am running the same issue. Even simple requests like the one below are failing:

addEventListener('fetch', event => {

async function handleRequest(request) {
    const apiUrl = 'https://slack.com/api';

    const composeReactionObject = {
        name: 'thumbsup',
        channel: `channel-ID-here`,
        timestamp: `timestamp-value-here`,

    if (request.method === 'GET') {
        try {
            const postToSlack = await fetch(`${apiUrl}/reactions.add`, {
                body: composeReactionObject,
                method: 'POST',
                headers: { 'Content-Type': 'application/json', 'Authorization': `slack-token-here` },
            return new Response(JSON.stringify(postToSlack))
        } catch (err) {
            return new Response(`Something went wrong: ${err}`, { status: 404 })

This is the response that I receive:

  "webSocket": null,
  "url": "https://slack.com/api/reactions.add",
  "redirected": false,
  "ok": true,
  "headers": {},
  "statusText": "OK",
  "status": 200,
  "bodyUsed": false,
  "body": {
    "locked": false

What might be going on here? A simple request on Glitch.com goes through.

Thanks for taking a look!

same problem here with similar code to manage a Shopify webhook. did you have any luck solving? thanks!

Anyone has a simple ou something solution?

A simples solution is using request.json() or request.text() like this…

const handler = async req => {
let body = await req.json();

return await new Response(JSON.stringify(body), {headers: {"Content-Type": "application/json"}});