How to send header information to report server?

2 posts, 0 answers
  1. Tursunhuja
    Tursunhuja avatar
    30 posts
    Member since:
    May 2018

    Posted 04 Dec 2019 Link to this post

    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?
  2. Todor
    Admin
    Todor avatar
    411 posts

    Posted 09 Dec 2019 Link to this post

    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
Back to Top