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

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

主站蜘蛛池模板: 微山县| 安丘市| 大埔区| 梅河口市| 慈利县| 台南市| 隆化县| 柳林县| 南皮县| 喀喇| 屯门区| 剑河县| 开阳县| 芒康县| 双峰县| 安图县| 卓尼县| 乡宁县| 巴里| 乐清市| 宁晋县| 永昌县| 当雄县| 马山县| 昌邑市| 加查县| 宿州市| 玛曲县| 五大连池市| 灵丘县| 建平县| 蓝山县| 枣庄市| 南华县| 房产| 四平市| 曲阜市| 会同县| 蓬安县| 西充县| 拜城县|