Workaround for external API which does not have CORS enabled?

可紊 提交于 2019-12-25 02:15:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!