blob: 03aa6b33f033dce71ba1ae6094a6472190d3afc2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
---
title: Access-Control-Request-Method
slug: Web/HTTP/Headers/Access-Control-Request-Method
tags:
- 请求首部
- 跨域资源共享
translation_of: Web/HTTP/Headers/Access-Control-Request-Method
---
<div>{{HTTPSidebar}}</div>
<div>请求头 <strong><code>Access-Control-Request-Method </code></strong>出现于 {{glossary("preflight request")}} (预检请求)中,用于通知服务器在真正的请求中会采用哪种 <a href="https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Methods">HTTP 方法</a>。因为预检请求所使用的方法总是 {{HTTPMethod("OPTIONS")}} ,与实际请求所使用的方法不一样,所以这个请求头是必要的。</div>
<table class="properties">
<tbody>
<tr>
<th scope="row">Header type</th>
<td>{{Glossary("Request header")}}</td>
</tr>
<tr>
<th scope="row">{{Glossary("Forbidden header name")}}</th>
<td>yes</td>
</tr>
</tbody>
</table>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">Access-Control-Request-Method: <method>
</pre>
<h2 id="指令">指令</h2>
<dl>
<dt><method></dt>
<dd>一种 <a href="/en-US/docs/Web/HTTP/Methods">HTTP请求方法 </a>, 例如 {{HTTPMethod("GET")}}、{{HTTPMethod("POST")}} 或 {{HTTPMethod("DELETE")}}。</dd>
</dl>
<h2 id="示例">示例</h2>
<pre>Access-Control-Request-Method: POST</pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Fetch','#http-access-control-request-method', 'Access-Control-Request-Method')}}</td>
<td>{{Spec2("Fetch")}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p>{{Compat("http.headers.Access-Control-Request-Method")}}</p>
<h2 id="相关内容">相关内容</h2>
<ul>
<li>{{HTTPHeader("Access-Control-Request-Headers")}}</li>
</ul>
|