Back

[Solved] Make post resquest in Appwrite function

  • 0
  • Self Hosted
  • Functions
LDs_Group
23 Oct, 2023, 10:01
TL;DR
Someone had a problem with making a post request in Appwrite function. The issue was that they forgot to parse the body in the functions. The problem has been solved by JSON stringifying the body before sending the request with the REST API.
LDs_Group
23 Oct, 2023, 10:11

After request

Meldiron
23 Oct, 2023, 10:51

Hello πŸ‘‹ When sending body to execution directly with REST API, make sure to JSON stringify the body first. The body must be string, but its object in your screenshot

LDs_Group
23 Oct, 2023, 10:56

Cool

LDs_Group
23 Oct, 2023, 10:56
LDs_Group
23 Oct, 2023, 10:57

Log is empty

LDs_Group
23 Oct, 2023, 10:58

As you can see

Meldiron
23 Oct, 2023, 11:00

Oh, I meant somrthing like this:

TypeScript
{
  "body": "{\"name\": \"Matej\"}"
}
Meldiron
23 Oct, 2023, 11:01

One sec, trying to figure out how to format it on mobile. πŸ˜…

LDs_Group
23 Oct, 2023, 16:23

solved

LDs_Group
23 Oct, 2023, 16:24

I forget to parse body in functions

LDs_Group
23 Oct, 2023, 16:24

[Solved] Make post resquest in Appwrite function

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