Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.02 KB

File metadata and controls

33 lines (24 loc) · 1.02 KB
layout post
title Add header values to AJAX requests | Syncfusion PDF Viewer
description Learn how to include custom headers in PDF Viewer AJAX requests using ajaxRequestSettings and ajaxHeaders in the JavaScript PDF Viewer component.
platform document-processing
control PDF Viewer
documentation ug

Add header values in the JavaScript PDF Viewer

Use the ajaxHeaders property inside the PDF Viewer's ajaxRequestSettings to send custom HTTP headers with each request made by the viewer.

Example: Add a custom Authorization header using ajaxRequestSettings in a JavaScript component

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

         headerValue: "Bearer 64565dfgfdsjweiuvbiuyhiueygf"
      }
   ],

   withCredentials: false
};

Sample: How to add custom headers using ajaxRequestSettings StackBlitz example