blob: 087a3f010773d9b3d9b3e0a7c3baed3bee5e3c03 (
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
68
69
70
|
---
title: Request.redirect
slug: Web/API/Request/redirect
tags:
- API
- Experimental
- Fetch
- Property
- Redirect
- Reference
- request
translation_of: Web/API/Request/redirect
---
<div>{{APIRef("Fetch")}}</div>
<p>{{domxref("Request")}} インターフェイスの <strong><code>redirect</code></strong> 読み取り専用プロパティには、リダイレクトの処理方法モードが含まれています。</p>
<h2 id="構文">構文</h2>
<pre class="brush: js notranslate">var myRedirect = request.redirect;</pre>
<h3 id="値">値</h3>
<p><code>RequestRedirect</code> 列挙値、次の文字列のいずれかになります:</p>
<ul>
<li><code>follow</code></li>
<li><code>error</code></li>
<li><code>manual</code></li>
</ul>
<p>request の作成時に指定されない場合、デフォルト値の <code>follow</code> になります。</p>
<h2 id="例">例</h2>
<p>次のスニペットでは、 {{domxref("Request.Request()")}} コンストラクタを使用して新しい request を作成し ( script と同じディレクトリにある画像ファイルの場合)、 request の <code>redirect</code> 値を変数に保存します:</p>
<pre class="brush: js notranslate">var myRequest = new Request('flowers.jpg');
var myCred = myRequest.redirect;</pre>
<h2 id="仕様">仕様</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">仕様</th>
<th scope="col">状態</th>
<th scope="col">コメント</th>
</tr>
<tr>
<td>{{SpecName('Fetch','#dom-request-redirect','redirect')}}</td>
<td>{{Spec2('Fetch')}}</td>
<td>初回定義。</td>
</tr>
</tbody>
</table>
<h2 id="ブラウザーの実装状況">ブラウザーの実装状況</h2>
<p>{{Compat("api.Request.redirect")}}</p>
<h2 id="関連項目">関連項目</h2>
<ul>
<li><a href="/ja/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/ja/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a></li>
<li><a href="/ja/docs/Web/HTTP">HTTP</a></li>
</ul>
|