aboutsummaryrefslogtreecommitdiff
path: root/files/uk/web/http/headers/location/index.html
blob: 0f68c1e1dc17960acfccbce6a1e32bcb35353195 (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
71
72
73
74
75
76
77
78
---
title: Location
slug: Web/HTTP/Заголовки/Location
translation_of: Web/HTTP/Headers/Location
---
<div>{{HTTPSidebar}}</div>

<p><span class="tlid-translation translation"><span title="">Заголовок відповіді </span></span><strong><code>Location</code></strong> <span class="tlid-translation translation"><span title="">вказує URL-адресу для перенаправлення сторінки.</span> <span title="">Він надає лише значення, коли подається відповідь зі статусом 3xx (перенаправлення) або 201 (створений).</span></span></p>

<p><span class="tlid-translation translation"><span title="">У випадках перенаправлення, метод HTTP, який використовується для внесення нового запиту на вибір сторінки, на яку позначається </span></span><code>Location</code><span class="tlid-translation translation"><span title="">, залежить від оригінального методу та виду перенаправлення:</span></span></p>

<ul>
 <li><span class="tlid-translation translation"><span title="">Якщо відповіді </span></span>{{HTTPStatus("303")}} (Див.також)<span class="tlid-translation translation"><span title=""> завжди призводять до використання методу </span></span>{{HTTPMethod("GET")}}<span class="tlid-translation translation"><span title="">, </span></span>{{HTTPStatus("307")}} <span class="tlid-translation translation"><span title="">(Тимчасове перенаправлення) та</span> </span>{{HTTPStatus("308")}}  <span class="tlid-translation translation"><span title="">(Постійне перенаправлення) не змінює метод, використаний у вихідному запиті;</span></span></li>
 <li><span class="tlid-translation translation"><span title="">{{HTTPStatus ("301")}} (Постійне перенаправлення) і {{HTTPStatus ("302")}} (Знайдено) не змінюють метод більшу частину часу, хоча старі користувачі-агенти можуть це робити (так що ви, в основному,</span> <span title="">не відомо).</span></span></li>
</ul>

<p><span class="tlid-translation translation"><span title="">Усі відповіді з одним із цих кодів стану надсилають заголовок </span></span><code>Location</code> <span class="tlid-translation translation"><span title="">.</span></span></p>

<p><span class="tlid-translation translation"><span title="">У випадках створення ресурсу, сервер вказує URL-адресу новоствореного ресурсу.</span></span></p>

<p><code>Location</code> <span class="tlid-translation translation"><span title="">та {{HTTPHeader ("Content-Location")}} є різними: </span></span><code>Location</code> <span class="tlid-translation translation"><span title="">вказує на ціль перенаправлення (або URL новоствореного ресурсу), тоді як {{HTTPHeader ("Content-Location")}} вказує на</span> <span title="">пряму URL-адресу, яка використовується для доступу до ресурсу, коли відбувається узгодження вмісту, без необхідності подальшого узгодження вмісту.</span> </span><code>Location</code> <span class="tlid-translation translation"><span title="">є заголовком, пов'язаним з відповіддю, тоді як {{HTTPHeader ("Content-Location")}} асоціюється з повернутим об'єктом.</span></span></p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Response header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="Синтаксис">Синтаксис</h2>

<pre class="syntaxbox">Location: &lt;url&gt;
</pre>

<h2 id="Директиви">Директиви</h2>

<dl>
 <dt>&lt;url&gt;</dt>
 <dd><span class="tlid-translation translation"><span title="">Відносна (до URL-адреси запиту) або абсолютна URL-адреса.</span></span></dd>
</dl>

<h2 id="Приклади">Приклади</h2>

<pre>Location: /index.html</pre>

<h2 id="Специфікації">Специфікації</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("7231", "Location", "7.1.2")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
  </tr>
 </tbody>
</table>

<h2 id="Сумісність_з_браузерами">Сумісність з браузерами</h2>

<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>

<p>{{Compat("http.headers.Location")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{HTTPHeader("Content-Location")}}</li>
 <li>Status of responses including a <code>Location</code> header: {{HTTPStatus("201")}}, {{HTTPStatus("301")}}, {{HTTPStatus("302")}}, {{HTTPStatus("303")}}, {{HTTPStatus("307")}}, {{HTTPStatus("308")}}.</li>
</ul>