Back

Post request to function with body values shows no values.

  • 0
  • Flutter
  • Functions
Runpace
13 Nov, 2023, 04:19

Hello, I am trying to pass { "myKey": "myValue" } as body to my Appwrite function yet I can't receive the values. When I send the values from dashboard values get send without a single problem but when I try to send it via postman or flutter body returns null. Can you help me out? Thanks.

TL;DR
User is having trouble passing a JSON object as the body to an Appwrite function. They have tried sending the values as raw body type in Postman and also with headers. The payload they tested is incorrect. The user should review the example provided in the documentation and ensure that the content-type header is set to application/json. The function URL also needs to follow the required format specified in the documentation.
Runpace
13 Nov, 2023, 04:30

and this is the postman, I also tried it with headers.

Drake
13 Nov, 2023, 04:32

If you're executing the function via that url, it needs to follow the required format

Drake
13 Nov, 2023, 04:34

Also, in postman, you should probably be using raw as the body type. Also, you'll need to pass application/json for the content-type header

Runpace
13 Nov, 2023, 04:35

I suppose these headers are correct

Runpace
13 Nov, 2023, 04:36

and tried sending them as raw body type

Drake
13 Nov, 2023, 04:36

Again, that's the incorrect payload. Please look at the example I linked

Runpace
13 Nov, 2023, 05:00

Thank you very much for your help! I finally figured out. So simple yet I somehow got lost.

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