2024 Mar 14 9:37 AM - edited 2024 Mar 14 9:39 AM
Hi CAP Experts,
following the docs here, it should be possible to provide a header parameter using srv.send:
await srv.send({ query: SELECT.from('Books'), headers: { some: 'header' } })
In my tests, I was not able to receive this provided header parameter in my Books handler. I'm accessing the headers this way: req.http.req.headers
I've created a little demo project to reproduce this behavior: https://github.com/nocin/cap_send_headers
Find my test queries in test/header.http
Do I misunderstand the docs or can someone give a hint, what I'm doing wrong?
Thanks!
Nico
As always, reading carefully helps. The headers are transferred to the CAP request object and not to the expressJS request object.
The passed header is therefore in req.headers and not in req.http.req.headers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
57 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.