<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: CAP - srv.send with headers in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cap-srv-send-with-headers/qaa-p/13638028#M4821803</link>
    <description>&lt;P&gt;As always, reading carefully helps. The headers are transferred to the CAP request object and not to the expressJS request object.&lt;/P&gt;&lt;P&gt;The passed header is therefore in &lt;STRONG&gt;req.headers&lt;/STRONG&gt; and not in &lt;STRONG&gt;req.http.req.headers&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 09:47:39 GMT</pubDate>
    <dc:creator>nicorunge</dc:creator>
    <dc:date>2024-03-14T09:47:39Z</dc:date>
    <item>
      <title>CAP - srv.send with headers</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-srv-send-with-headers/qaq-p/13637996</link>
      <description>&lt;P&gt;Hi CAP Experts,&lt;/P&gt;&lt;P&gt;following the docs &lt;A href="https://cap.cloud.sap/docs/node.js/core-services#srv-send-request" target="_self"&gt;here,&lt;/A&gt; it should be possible to provide a header parameter using srv.send:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;await srv.send({ query: SELECT.from('Books'), headers: { some: 'header' } })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my tests, I was not able to receive this provided header parameter in my Books handler. I'm accessing the headers this way: &lt;STRONG&gt;&lt;SPAN&gt;req&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;http&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;req&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've created a little demo project to reproduce this behavior: &lt;A href="https://github.com/nocin/cap_send_headers" target="_self"&gt;https://github.com/nocin/cap_send_headers&lt;/A&gt;&lt;BR /&gt;Find my test queries in &lt;EM&gt;test/header.http&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Do I misunderstand the docs or can someone give a hint, what I'm doing wrong?&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;Nico&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 09:39:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-srv-send-with-headers/qaq-p/13637996</guid>
      <dc:creator>nicorunge</dc:creator>
      <dc:date>2024-03-14T09:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: CAP - srv.send with headers</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-srv-send-with-headers/qaa-p/13638028#M4821803</link>
      <description>&lt;P&gt;As always, reading carefully helps. The headers are transferred to the CAP request object and not to the expressJS request object.&lt;/P&gt;&lt;P&gt;The passed header is therefore in &lt;STRONG&gt;req.headers&lt;/STRONG&gt; and not in &lt;STRONG&gt;req.http.req.headers&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 09:47:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-srv-send-with-headers/qaa-p/13638028#M4821803</guid>
      <dc:creator>nicorunge</dc:creator>
      <dc:date>2024-03-14T09:47:39Z</dc:date>
    </item>
  </channel>
</rss>

