diff options
Diffstat (limited to 'files/de/web/http/headers/accept')
-rw-r--r-- | files/de/web/http/headers/accept/index.html | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/files/de/web/http/headers/accept/index.html b/files/de/web/http/headers/accept/index.html new file mode 100644 index 0000000000..072e1bebd3 --- /dev/null +++ b/files/de/web/http/headers/accept/index.html @@ -0,0 +1,96 @@ +--- +title: Accept +slug: Web/HTTP/Headers/Accept +tags: + - Anfrage-Header + - HTTP + - HTTP Header +translation_of: Web/HTTP/Headers/Accept +--- +<div>{{HTTPSidebar}}</div> + +<p>Der <strong><code>Accept</code></strong> Anfrage-HTTP-Header drückt aus, welche Inhaltstypen, ausgedrückt als <a href="/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">MIME-Typen (MIME-Types)</a>, der anfragende Client unterstützt. Durch <a href="/en-US/docs/Web/HTTP/Content_negotiation">Inhalts-Aushandlung (Content negotiation)</a> wählt der Ziel-Server einen Inhalts-Typen aus, verwendet diesen für den Inhalt und teilt dem Client diesen über den Antwort-HTTP-Header {{HTTPHeader("Content-Type")}} mit. Browser setzen entsprechende Inhalts-Typen automatisch, je nachdem in welchem Kontext die Anfrage stattfindet: Wenn ein CSS-Stylesheet angefragt wird, wird ein anderer Inhalts-Typ verwendet wie wenn ein Bild, Video oder Script angefragt wird.</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Header-Typ</th> + <td>{{Glossary("Request header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>Nein</td> + </tr> + <tr> + <th scope="row">{{Glossary("CORS-safelisted request header")}}</th> + <td>Ja, mit der zusätzlichen Restriktion dass die Werte keine <em>CORS-unsicheren Anfrage-Header-Bytes</em> enthalten dürfen: <code>"():<>?@[\]{}</code>, Delete, Tab und Kontrollzeichen: 0x00 to 0x19.</td> + </tr> + </tbody> +</table> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox">Accept: <MIME_type>/<MIME_subtype> +Accept: <MIME_type>/* +Accept: */* + +// Mehrere Werte, gewichtet mit der {{glossary("quality values", "quality value")}} Syntax: +Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8 +</pre> + +<h2 id="Direktiven">Direktiven</h2> + +<dl> + <dt><code><MIME_type>/<MIME_subtype></code></dt> + <dd>Ein einfacher, präziser <a href="/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">MIME-Type</a> wie <code>text/html</code>.</dd> + <dt><code><MIME_type>/*</code></dt> + <dd>Ein Mime-Type, aber ohne einen Untertypen. <code>image/*</code> z.B. stimmt mit <code>image/png</code>, <code>image/svg</code>, <code>image/gif</code> und allen anderen Bild-Typen überein.</dd> + <dt><code>*/*</code></dt> + <dd>Irgend ein MIME-Type</dd> + <dt><code>;q=</code> (q-Faktor Gewichtung)</dt> + <dd>Jeder verwendete Wert definiert eine Ordnung der Präferenzen durch einen relativen <a href="/en-US/docs/Glossary/Quality_values">Qualitätswert (Quality value)</a>, auch als <strong>Gewichtung</strong> bezeichnet.</dd> +</dl> + +<h2 id="Beispiele">Beispiele</h2> + +<pre>Accept: text/html + +Accept: image/* + +// Standard für allgemeine Anfragen +Accept: */* + +// Standard für Navigations-Anfragen im Browser +Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8 +</pre> + +<h2 id="Spezifikationen">Spezifikationen</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Title</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{RFC("7231", "Accept", "5.3.2")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Context</td> + </tr> + </tbody> +</table> + +<h2 id="Browserkompatibilität">Browserkompatibilität</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.Accept")}}</p> + +<h2 id="Siehe_auch">Siehe auch</h2> + +<ul> + <li>HTTP <a href="/en-US/docs/Web/HTTP/Content_negotiation">Inhalts-Aushandlung (Content negotiation)</a></li> + <li>Header, der das Ergebnis der Aushandlung enthält: {{HTTPHeader("Content-Type")}}</li> + <li>Andere, ähnliche Header: {{HTTPHeader("TE")}}, {{HTTPHeader("Accept-Encoding")}}, {{HTTPHeader("Accept-Charset")}}, {{HTTPHeader("Accept-Language")}}</li> +</ul> |