官术网_书友最值得收藏!

Accessing APIs from JavaScript

Web browsers implement a sandbox mechanism that restricts resources in one domain from accessing resources in another. For example, you may have an API that allows the modification and retrieval of user data and a website that provides an interface for this API. If the browser did not implement the "same-origin policy" and assuming the user did not log out of their session then it would be possible for a malicious page to send a request to the API and modify it without you knowing.

To get around this, there are two methods that can be implemented by your microservice to allow this access, JSONP which stands for (JSON with Padding) and CORS (Cross-Origin Resource Sharing).

主站蜘蛛池模板: 格尔木市| 高唐县| 普安县| 漳州市| 屏南县| 宁海县| 嘉善县| 于田县| 高碑店市| 石家庄市| 黄冈市| 福建省| 容城县| 临高县| 德州市| 鸡东县| 仁化县| 芮城县| 永城市| 承德市| 炎陵县| 台东县| 武城县| 正宁县| 宜春市| 米林县| 绥中县| 延津县| 纳雍县| 资源县| 陆良县| 嘉祥县| 株洲县| 武穴市| 图们市| 湖口县| 武汉市| 神农架林区| 保靖县| 汉中市| 神木县|