on 2022 Jun 27 6:39 AM
Hi Experts,
I want to add some custom headers in response of Odata read on an entity. Is it possible in SAP Cloud application programming model (CAP)
Best Regards, Ajit
Request clarification before answering.
I currently use:
req._.odataRes.setHeader
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the meantime, you can avoid private APIs and use
req.res.setHeader()
Kind regards,
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or access the express response object with
req._.res
and call it's function set e.g.:
req._.res.set('field','value')
David hinted that In future (cds 6), there will be cds.context.http.{req, res} to access the express req/res object.
Best regards,
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
24 | |
22 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.