aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/http/headers/host/index.html
blob: 6253bae273e4667c04297d4a73586be9e0888598 (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
---
title: Host
slug: Web/HTTP/Headers/Host
translation_of: Web/HTTP/Headers/Host
---
<div>{{HTTPSidebar}}</div>

<div> </div>

<p>O cabeçalho de solicitação de <code><strong>Host</strong></code> especifica o nome de domínio do servidor (para hospedagem virtual), e (opcionalmente) o número da porta TCP no qual o servidor está escutando.</p>

<p>Se nenhuma porta for fornecida a porta padrão para o serviço solicitado (por exemplo, "80" para um HTTP URL) está implícita.</p>

<p>Um campo de cabeçalho de <code>Host </code>deve ser enviado em todas as mensagens desolicitação HTTP / 1. 1. Um código de status {{HTTPStatus("400")}} (Bad Request) será enviado para qualquer mensagem de solicitação HTTP/1.1 que não contenha um campo de cabeçalho do host ou contenha mais de um.</p>

<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="Syntax">Syntax</h2>

<pre class="syntaxbox">Host: &lt;host&gt;:&lt;port&gt;
</pre>

<h2 id="Directives">Directives</h2>

<dl>
 <dt>&lt;host&gt;</dt>
 <dd>the domain name of the server (for virtual hosting).</dd>
 <dt>&lt;port&gt; {{optional_inline}}</dt>
 <dd>TCP port number on which the server is listening.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<pre>Host: developer.mozilla.org</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("7230", "Host", "5.4")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</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.Host")}}</p>

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

<ul>
 <li>{{HTTPStatus("400")}}</li>
</ul>