Back

How to Set Headers and process them in AppWrite Functions

  • 0
  • Functions
SenZi
22 Mar, 2023, 17:52

Hi, I want to set a custom header and read that in appwrite function. Currently i tried setting a header in postman but in the appwrite function req.headers returns {}

TL;DR
The user wants to know how to set custom headers and read them in an AppWrite function. Another user mentions that currently, it is not possible to set headers directly with functions, and all data should be passed as part of the 'data' parameter. The user confirms that when they tried setting a header in Postman, the req.headers object in the AppWrite function returned {}. No solution is provided in the thread.
Drake
22 Mar, 2023, 17:55

you can't do that with functions at the moment. all data passed in should be passed as part of the data parameter: https://appwrite.io/docs/client/functions?sdk=web-default#functionsCreateExecution

SenZi
22 Mar, 2023, 17:57

So req.headers doesn't have any purpose?

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