blob: c5edcffb7bff018b83ef839c3015817aff2fd7ca (
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: Host
slug: Web/HTTP/Headers/Host
tags:
- HTTP
- Host
- Italiano
- Reference
- header
translation_of: Web/HTTP/Headers/Host
---
<div>{{HTTPSidebar}}</div>
<p>L'header di richiesta <code><strong>Host</strong></code> nei messaggi HTTP specifica il nome di dominio del server (per l'hosting virtuale) e (opzionalmente) il numero di porta TPC su cui il server è in ascolto.</p>
<p>Se non viene specificata nessuna porta, viene utilizzata quella di default del servizio richiesto (ad esempio "80" per HTTP).</p>
<p>L'header <code>Host</code> deve essere inviato in tutte le richieste HTTP/1.1. Un codice di stato (status code) {{HTTPStatus("400")}} (Bad Request) verrà inviato in risposta a qualsiasi richiesta HTTP/1.1 che non dispone di un campo header <code>Host</code> o ne contiene più di uno.</p>
<table class="properties">
<tbody>
<tr>
<th scope="row">Tipo di header</th>
<td>{{Glossary("Header di richiesta")}}</td>
</tr>
<tr>
<th scope="row">{{Glossary("Nome header vietato")}}</th>
<td>Sì</td>
</tr>
</tbody>
</table>
<h2 id="Sintassi">Sintassi</h2>
<pre class="syntaxbox">Host: <host>:<porta>
</pre>
<h2 id="Direttive">Direttive</h2>
<dl>
<dt><host></dt>
<dd>il nome di dominio del server (per l'hosting virtuale).</dd>
<dt><porta> {{optional_inline}}</dt>
<dd>il numero di porta TCP su cui il server è in ascolto.</dd>
</dl>
<h2 id="Esempi">Esempi</h2>
<pre>Host: developer.cdn.mozilla.net</pre>
<h2 id="Specifiche">Specifiche</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specifica</th>
<th scope="col">Titolo</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="Compatibilità_con_i_browser">Compatibilità con i browser</h2>
<p class="hidden">La tabella di compatibilità in questa pagina è generata da dati strutturati. Se vuoi contribuire ai dati, per favore controlla <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> e inviaci una richiesta.</p>
<p>{{Compat("http.headers.Host")}}</p>
<h2 id="Vedi_anche">Vedi anche</h2>
<ul>
<li>{{HTTPStatus("400")}}</li>
<li>{{HTMLElement("base")}}</li>
</ul>
|