<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Custom HTTP header not attached to request fired via @jsreport&#x2F;browser-client]]></title><description><![CDATA[<p>jsreport v3.10.0<br />
@jsreport/browser-client v3.1.0<br />
Browser: Google Chrome, v110.0.5481.177</p>
<p>We have a jsreport server with which interact from a browser UI application via @jsreport/browser-client npm module.</p>
<p>For now we're trying to print one of the samples provided at initialisation step:</p>
<pre><code>jsreport.serverUrl = 'http://localhost:5488';
jsreport.download('invoice.pdf', {
  template: {name: 'invoice-main'},
  data: { ... }
}
</code></pre>
<p>We wish to attach a custom header to the request, such as <code>X-Header</code>. As per the documentation <a href="https://jsreport.net/learn/browser-client" rel="nofollow">here</a>, we attach the header as such: <code>jsreport.headers['X-Header'] = 'value';</code>.</p>
<p>The request is successful, and we receive a proper PDF back. But, this does not attach the HTTP header to the request, and instead has no effect. This behaviour was seen by inspecting the request the Chrome dev-tools.</p>
<p>The ordering of the statements and call to the jsreport instance are below:</p>
<pre><code>import jsreport from '@jsreport/browser-client';

jsreport.headers['X-Header'] = 'value';

jsreport.serverUrl = 'http://localhost:5488';

jsreport.download('invoice.pdf', {
  template: {name: 'invoice-main'},
  data: { ... }
}
</code></pre>
]]></description><link>https://forum.jsreport.net/topic/2738/custom-http-header-not-attached-to-request-fired-via-jsreport-browser-client</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 11:51:49 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2738.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 14 Mar 2023 14:36:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Custom HTTP header not attached to request fired via @jsreport&#x2F;browser-client on Tue, 14 Mar 2023 14:37:31 GMT]]></title><description><![CDATA[<p>jsreport v3.10.0<br />
@jsreport/browser-client v3.1.0<br />
Browser: Google Chrome, v110.0.5481.177</p>
<p>We have a jsreport server with which interact from a browser UI application via @jsreport/browser-client npm module.</p>
<p>For now we're trying to print one of the samples provided at initialisation step:</p>
<pre><code>jsreport.serverUrl = 'http://localhost:5488';
jsreport.download('invoice.pdf', {
  template: {name: 'invoice-main'},
  data: { ... }
}
</code></pre>
<p>We wish to attach a custom header to the request, such as <code>X-Header</code>. As per the documentation <a href="https://jsreport.net/learn/browser-client" rel="nofollow">here</a>, we attach the header as such: <code>jsreport.headers['X-Header'] = 'value';</code>.</p>
<p>The request is successful, and we receive a proper PDF back. But, this does not attach the HTTP header to the request, and instead has no effect. This behaviour was seen by inspecting the request the Chrome dev-tools.</p>
<p>The ordering of the statements and call to the jsreport instance are below:</p>
<pre><code>import jsreport from '@jsreport/browser-client';

jsreport.headers['X-Header'] = 'value';

jsreport.serverUrl = 'http://localhost:5488';

jsreport.download('invoice.pdf', {
  template: {name: 'invoice-main'},
  data: { ... }
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/11858</link><guid isPermaLink="true">https://forum.jsreport.net/post/11858</guid><dc:creator><![CDATA[Anghel Lucian]]></dc:creator><pubDate>Tue, 14 Mar 2023 14:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to Custom HTTP header not attached to request fired via @jsreport&#x2F;browser-client on Invalid Date]]></title><description><![CDATA[<p>Yes, this is mentioned in the docs.<br />
The <code>jsreport.download</code> and <code>jsreport.openInNewWindow</code> doesn't support sending custom headers, becase they are submitting hidden form internaly.</p>
<p>What you need to use is <code>jsreport.render</code> and then call <code>download</code> on the result.</p>
<pre><code>jsreport.serverUrl = 'http://myjsreport.com'
const report = await jsreport.render({
  template: {
    content: 'Hello from {{message}}',
    engine: 'handlebars',
    recipe: 'chrome-pdf'
  },
  data: {
    someData: 'browser client'
  }
})
report.download('myreport.pdf')
</code></pre>
]]></description><link>https://forum.jsreport.net/post/11859</link><guid isPermaLink="true">https://forum.jsreport.net/post/11859</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Custom HTTP header not attached to request fired via @jsreport&#x2F;browser-client on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/2">@jan_blaha</a> Your suggestion solved the issue. Thank you!</p>
]]></description><link>https://forum.jsreport.net/post/11861</link><guid isPermaLink="true">https://forum.jsreport.net/post/11861</guid><dc:creator><![CDATA[Anghel Lucian]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>