This is a migrated thread and some comments may be shown as answers.

How to send header information to report server?

1 Answer 313 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Tursunkhuja asked on 04 Dec 2019, 12:31 PM
I am using the HTML5ReportViewer and the reporting REST API
How can I add some custom HTTP headers to html5 report viewer to send it to the report service?

1 Answer, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 09 Dec 2019, 10:31 AM

Hi Tursunhuja,

You may use the jQuery.ajaxPrefilter() event. Check for example the Add custom http header to all jQuery AJAX Requests Stackoverflow thread. You may add the following code to the page of the viewer:

$.ajaxPrefilter(function( options ) {
    if ( !options.beforeSend) {
        options.beforeSend = function (xhr) { 
            xhr.setRequestHeader('CUSTOM-HEADER-KEY', 'CUSTOM-HEADER-VALUE');
        }
    }
});

Regards,
Todor
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Todor
Telerik team
Share this question
or