Hi I know that to return response from Appwrite cloud function I do the following
return context.res.send(body);
but how can I add value to the returned header. For example
final tokens = 10;
// I want to add the variable "tokens" to the hader of the returned response
return context.res.send(body);
In the above example I want to **append ** the tokens to the **header **not the body
You can do
…send(body, 200, {
"tokens": "…",
})
Great, thanks
Can this be marked as solved now?
Yes
[SOLVED] How to add value to headers in Cloud Functions
Recommended threads
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...
- Custom API domain is unreachable
Earlier my custom api domain was working fine. Now it seems to be offline without a trace a few hours later. I didn't change anything, all the relevant DNS reco...
- "Invalid console fingerprint" when unpau...
I've tried logging out and logging back in, still can't figure out why this is happening.