Skip to content
Back

Error getDocument: request cannot have request body

  • 0
  • Functions
  • Web
  • Cloud
Horsty - Cyril - MagicTools
15 Apr, 2025, 17:40

I don't understand why is the meaning of this error

In my Appwrite function, when i execute it, i get this error in my try/catch request cannot have request body any idea of the root cause ?

TypeScript
    log(`I get this: ${payload.tournamentId}`); // show the expected id

    const tournament = await databases.getDocument(
      process.env.APPWRITE_DATABASE_ID, // < it's setup in the settings sections
      "tournaments",
      payload.tournamentId // < it's exist in my collection "tournaments"
    );
// 🔥 Crash here     "responseBody": "{\"success\":false,\"message\":\"request cannot have request body\"}",

    log(`I didn't get this: ${tournament}`); 

I'm using appwrite cloud

TL;DR
Error message "request cannot have request body" is triggered when calling the `getDocument` function in Appwrite. This might be due to incorrect parameter types or mismatch in the Appwrite setup configurations. Double-check the function call parameters and Appwrite settings to resolve the error.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more