办事器 3001上对应的处理函数:
- app.post('/cors', function(req, res) {
- res.header("Access-Control-Allow-Origin", "*");
- res.header("Access-Control-Allow-Headers", "X-Requested-With");
- res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
- res.header("X-Powered-By", ' 3.2.1')
- res.header("Content-Type", "application/json;charset=utf-8");
- var data = {
- name: req.body.name + ' - server 3001 cors process',
- id: req.body.id + ' - server 3001 cors process'
- }
推荐阅读
一、简介本文是对16年的blackhat大年夜会上PinDemonium通用动态脱壳对象介绍。1. 通用脱壳对象简介通用脱壳对象可以经由过程以下办法实现: -debuggers -kernel modules -hyperv>>>详细阅读
本文标题:前端跨域请求原理及实践
地址:http://www.17bianji.com/lsqh/35417.html
1/2 1

网友点评
精彩导读
科技快报
品牌展示