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
- fastly error
Hey! I'm hitting a Fastly error on the www version of our site, but the root domain works fine. We have a wildcard set up, so I expected the subdomain to be cov...
- Facebook's scraper facebookexternalhit g...
share.bardbliss.com but works fine on the raw fra.appwrite.run URL. No execution logs appear when Facebook hits the custom domain. This was working before. How ...
- How to Display File in Web?
I'm trying to use Appwrite's Storage to store images and display them in my app, however when I use the `getFileView`, `getFileDownload` or `getFilePreview` met...