当前位置:网站首页>1-20 预检请求
1-20 预检请求
2022-06-30 21:26:00 【画不完的饼】
预检请求
CORS请求的分类
客户端在请求CORS借口时,根据请求方式和请求头的不同,可以讲CORS的请求分为两大类,分别是:
1. 简单请求
同时满足以下两大条件的请求,就属于简单请求:
(1)请求方式:GET、POST、HEAD三者之一
(2)HTTP头部信息不超过以下几种字段:
无自定义头部字段、Accept、Accept-Language、Content-Language、DPR、Downlink、Save-Data、Viewport-Width、Width、Content-Type(只有三个值application/x-www-form-urlencoded、multipart/form-data、text/plain)
2. 预检请求
只要符合以下任何一个条件的请求,都需要进行预检请求:
- 请求方式为GET、POST、HEAD、之外的请求Method类型
- 请求头中包含自定义头部字段
- 向服务器发送了application/json格式的数据
在浏览器与服务器正式通信之前,浏览器会先发送OPTION请求进行预检,以获知服务器是否允许该实际请求,所以这一次的OPTION请求成为“预检请求”。服务器成功响应预检请求后,才会发送真正的请求,并且携带真实数据。
边栏推荐
猜你喜欢
随机推荐
Side sleep ha ha ha
How to run jenkins build, in multiple servers with ssh-key
在手机炒股开户安全吗?
侧睡哈哈哈哈
毕业五年,想当初若没有入行测试,我是否还会如这般焦虑
将el-table原样导出为excel表格
Understand what MySQL index push down (ICP) is in one article
vim 常用快捷键
Introduction of 3D Max fine model obj model into ArcGIS pro (II) key points supplement
Adobe-Photoshop(PS)-脚本开发-去除文件臃肿脚本
sdfsdf
Analysis and proposal on the "sour Fox" vulnerability attack weapon platform of the US National Security Agency
减少嵌入式软件调试时间的三个技巧
twelve thousand three hundred and forty-five
asp. Net core JWT delivery
What happens when word encounters an error while trying to open a file?
两个skyline
Fletter nested hell? No, constraintlayout to save!
本地浏览器打开远程服务器上的Jupyter Notebook/Lab以及常见问题&设置
变异系数法matlab代码[通俗易懂]









