In This Topic
Reference Guides / JavaScript API / Actions / Requests / SetAjaxCustomHeaders

SetAjaxCustomHeaders

In This Topic
 SetAjaxCustomHeaders

This function allows you to specify custom headers for the subsequently generated AJAX requests.

SetAjaxCustomHeaders: function (docuViewareID, headers)

Parameters

docuViewareID
The identifier for the DocuVieware™ instance you want to configure.
headers
The custom headers. Can be a string (containing a JSON), an object, or an array.

Return Value

1 if error, 0 if success.

Example of usage

Specifying custom headers .

//From Array :
DocuViewareAPI.SetAjaxCustomHeaders("DocuVieware1", [ ["X-Custom-Header", "Bearer TOKEN"] ]);

//From Object: 
DocuViewareAPI.SetAjaxCustomHeaders("DocuVieware1", {"X-Custom-Header" : "Bearer TOKEN"});

//From String String : 
DocuViewareAPI.SetAjaxCustomHeaders("DocuVieware1", '{"X-Custom-Header" : "Bearer TOKEN"}');