Here i will explain how to set global header in ajax call.
I have used beforesend event to set header before calling ajax mathod.
I have used beforesend event to set header before calling ajax mathod.
$.ajaxSetup({ beforeSend: function (xhr) { xhr.setRequestHeader("Accept", "application/vvv.website+json;version=1"); xhr.setRequestHeader("Authorization", "Basic abc"); } });
Comments
Post a Comment