Search results

Add custom headers in AjaxRequestSettings in JavaScript (ES5) PDF Viewer control

25 Jan 2023 / 1 minute to read

To add header values to an AJAX request made by a Syncfusion PDF Viewer, you can use the ajaxHeaders property available in the ajaxRequestSettings module of the PDF Viewer. This property allows you to specify custom headers for the AJAX request.

Here is an example of how you can use the ajaxRequestSettings property to add a custom header to an AJAX request made by the PDF Viewer:

Copied to clipboard
viewer.ajaxRequestSettings = {
   ajaxHeaders: [
      {
         headerName: "Authorization",

         headerValue: "Bearer 64565dfgfdsjweiuvbiuyhiueygf"
      }
   ],

   withCredentials: false
};

Find the sample how to add custom headers in AjaxRequestSettings