Back

Function body must be exactly 0 chars

  • 0
  • Functions
  • Cloud
faye
26 Aug, 2024, 01:46

Heyo.

I tried sending a body to a function, but I got:

TypeScript
 [AppwriteException: Invalid `body` param: Value must be a valid string and exactly 0 chars]

So am I only allowed to send an empty body? What if I want to send a body?

TL;DR
Issue: Error message stating "Function body must be exactly 0 chars" despite wanting to pass a body to a function. Developer suspects the error is misleading and suggests sending an empty string instead of undefined. Solution: It seems the error message is misleading. Try sending an empty string as the body instead of undefined if you wish to pass a body to the function.
Steven
26 Aug, 2024, 01:49

I think the error is wrong...you should be able to send a body

faye
26 Aug, 2024, 01:53

Seems I forgot to stringify the body.. However, yeah, the error is incorrect

I think what it's trying to say is to send an empty body, put in an empty string instead of .. undefined probably

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