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

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).

主站蜘蛛池模板: 梁河县| 保山市| 景德镇市| 嘉祥县| 太仓市| 青河县| 桐乡市| 咸阳市| 滦平县| 永州市| 鄂伦春自治旗| 海原县| 刚察县| 刚察县| 黎平县| 广宁县| 巨野县| 黑河市| 洞头县| 崇文区| 德令哈市| 连南| 怀远县| 黄山市| 江西省| 清徐县| 中江县| 东台市| 临汾市| 犍为县| 嘉兴市| 昌吉市| 大埔县| 宿迁市| 营山县| 昌平区| 湖北省| 红安县| 和顺县| 荣成市| 临夏市|