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

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

主站蜘蛛池模板: 克什克腾旗| 珲春市| 天峨县| 巨野县| 新安县| 诸城市| 杭州市| 康保县| 蒙自县| 高安市| 武川县| 刚察县| 五莲县| 东乌珠穆沁旗| 廊坊市| 尚义县| 阳西县| 泰来县| 当雄县| 汶上县| 榆中县| 通城县| 中江县| 巴林右旗| 博白县| 萨迦县| 社旗县| 扶沟县| 南京市| 当阳市| 葵青区| 凤山县| 谢通门县| 房产| 安国市| 阿鲁科尔沁旗| 年辖:市辖区| 中超| 桃园县| 旬邑县| 成武县|