Skip to content

Commit 3b340f1

Browse files
Update custom-headers-with-reportviewer-rest-api-calls.md (#1743)
1 parent efeed07 commit 3b340f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

knowledge-base/custom-headers-with-reportviewer-rest-api-calls.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Starting from `19.1.25.521`, the HTML5-based report viewers rely on the browser'
6565

6666
const headers = new Headers(init?.headers || {});
6767

68-
if (typeof input === "string" && input.includes('api/reports')) {
68+
if (typeof input === 'string' && input.includes('api/reports')) {
6969
headers.set('X-Custom-Header', 'YourHeaderValue');
7070
}
7171

@@ -80,11 +80,11 @@ Starting from `19.1.25.521`, the HTML5-based report viewers rely on the browser'
8080
````JavaScript
8181
const originalFetch = window.fetch;
8282

83-
window.fetch = async function (input, init?) {
83+
window.fetch = async function (input, init) {
8484

8585
const headers = new Headers(init?.headers || {});
8686

87-
if (typeof input === "string" && input.includes('api/reports')) {
87+
if (typeof input === 'string' && input.includes('api/reports')) {
8888
headers.set('X-Custom-Header', 'YourHeaderValue');
8989
}
9090

@@ -102,18 +102,18 @@ Starting from `19.1.25.521`, the HTML5-based report viewers rely on the browser'
102102
Before the [2025 Q2 release](https://www.telerik.com/support/whats-new/reporting/release-history/progress-telerik-reporting-2025-q2-19-1-25-521), the report viewer implementation relied on jQuery-based requests. To add custom HTTP headers in this scenario, you can use jQuery's [ajaxSetup()](https://api.jquery.com/jquery.ajaxsetup/) function:
103103

104104
````TypeScript
105-
const $: any = (window as any)["jQuery"];
105+
const $: any = (window as any)['jQuery'];
106106

107107
$.ajaxSetup({
108108
beforeSend: function (xhr: XMLHttpRequest) {
109-
xhr.setRequestHeader('X-Custom-Header', "CustomValue");
109+
xhr.setRequestHeader('X-Custom-Header', 'CustomValue');
110110
}
111111
});
112112
````
113113
````JavaScript
114114
$.ajaxSetup({
115115
beforeSend: function (xhr: XMLHttpRequest) {
116-
xhr.setRequestHeader('X-Custom-Header', "CustomValue");
116+
xhr.setRequestHeader('X-Custom-Header', 'CustomValue');
117117
}
118118
});
119119
````

0 commit comments

Comments
 (0)