aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/http/headers/link/index.html
blob: 3df78e1a3535a9b57f7c36a72e8a18072bdc8ef0 (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
---
title: Link
slug: Web/HTTP/Headers/Link
tags:
  - Cabeçalho HTTP
  - HTTP
  - Link
  - Rascunho
  - Referencia
translation_of: Web/HTTP/Headers/Link
---
<div>{{HTTPSidebar}}</div>

<p>O cabeçalho de entidade <strong><code>Link</code></strong> provém maneiras para serializar um ou mais links em cabeçalhos HTTP. Ele é semanticamente equivalente ao elemento HTML {{HTMLElement("link")}}.</p>

<h2 id="Sintaxe">Sintaxe</h2>

<pre class="syntaxbox notranslate">Link: &lt; <var>uri-reference</var> &gt;; <var>param1</var>=<var>value1</var>; <var>param2</var>="<var>value2</var>"</pre>

<dl>
 <dt><code>&lt;uri-reference&gt;</code></dt>
 <dd>A referência da URI, precisa ser encapsulado entre <code>&lt;</code> e <code>&gt;</code>.</dd>
</dl>

<h3 id="Parâmetros">Parâmetros</h3>

<p>O cabeçalho <em>link</em> contém parâmetros, os quais são separados com <code>;</code> e são equivalentes aos atributos do elemento {{HTMLElement("link")}}.</p>

<h2 id="Exemplos">Exemplos</h2>

<p>A URI precisa ser encapsulado entre <code>&lt;</code> e <code>&gt;</code>:</p>

<pre class="brush: http; no-line-numbers example-good notranslate">Link: &lt;https://example.com&gt;; rel="preconnect"</pre>

<pre class="brush: http; no-line-numbers example-bad notranslate">Link: https://bad.example; rel="preconnect"</pre>

<h3 id="Especificando_múltiplos_links">Especificando múltiplos <em>links</em></h3>

<p>Você pode especificar múltiplos <em>links</em> separados por vírgulas, por exemplo:</p>

<pre class="notranslate">Link: &lt;https://one.example.com&gt;; rel="preconnect", &lt;https://two.example.com&gt;; rel="preconnect", &lt;https://three.example.com&gt;; rel="preconnect"</pre>

<h2 id="Especificações">Especificações</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Especificação</th>
   <th scope="col">Status</th>
   <th scope="col">Comentários</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{RFC(8288, "Link Serialisation in HTTP Headers", 3)}}</td>
   <td><span class="spec-RFC">IETF RFC</span></td>
   <td></td>
  </tr>
  <tr>
   <td>{{RFC(5988, "The Link Header Field", 5)}}</td>
   <td><span class="spec-RFC">IETF RFC</span></td>
   <td>Definição inicial</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidade_de_navegador">Compatibilidade de navegador</h2>



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

<h2 id="Veja_também">Veja também</h2>

<ul>
 <li>{{HTTPStatus(103, "103 Early Hints")}}</li>
</ul>