| 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 |
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