问题
What can be the workarounds for using an external API like Docusign which does not have CORS enabled and requires a custom HTTP header for authentication ?
I am trying to integrate this API with my angular app running on localhost.
I cannot add Access-Control-Allow-Origin Header and disabling web security on Chrome is a foolish solution.
JSONP is also out of the window as I cannot add a custom HTTP Header to a JSONP request.
回答1:
What can be the workarounds for using an external API like Docusign which does not have CORS enabled and requires a custom HTTP header for authentication ?
I dont know Docusign but if they dont support CORS nor jsonp, You just cant send an ajax request from AngularJS.You need a proxy server app that will do the call.
来源:https://stackoverflow.com/questions/21987824/workaround-for-external-api-which-does-not-have-cors-enabled