问题
I am trying to download a file using jquery.download plugin, for this I make an API call, but the issue is my API is under [Authorize]
restriction, hence API call is not being made. I think it is missing Authentication header.
My function is
function ExportStS(getAll, type, print) {
var path = api_url + 'api/SharedDocument/GetStateSummaryExport';
$.fileDownload(path, {
httpMethod: "POST"
});
return false;
}
When I see the console I see this message
Failed to load resource: the server responded with a status of 401 (Unauthorized)
来源:https://stackoverflow.com/questions/41930661/jquery-download-fails-to-make-api-call-which-is-authorize-restricted