问题
I want to support multiple json versions on my swagger-ui version 3.0.
The second json at every ajax call I want to add a custom header
with name x-api-version
and value 2
I tried this one:
$.ajaxSetup({
beforeSend: function(xhr) {
xhr.setRequestHeader('x-my-custom-header', 'some value');
}
});
But it is not working. The documentation of swagger ui 3.0.0 is poor and I can't find a solution
来源:https://stackoverflow.com/questions/45085426/how-to-add-a-custom-header-for-every-request-in-swagger-ui-version-3-0