Files
mercator_service/http/header/index.html

215 lines
35 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `header` mod in crate `http`."><meta name="keywords" content="rust, rustlang, rust-lang, header"><title>http::header - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../http/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module header</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../index.html'>http</a></p><script>window.sidebarCurrent = {name: 'header', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/http/header/mod.rs.html#1-196' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>http</a>::<wbr><a class="mod" href=''>header</a></span></h1><div class='docblock'><p>HTTP header types</p>
<p>The module provides <a href="struct.HeaderName.html"><code>HeaderName</code></a>, <a href="struct.HeaderMap.html"><code>HeaderMap</code></a>, and a number of types
used for interacting with <code>HeaderMap</code>. These types allow representing both
HTTP/1 and HTTP/2 headers.</p>
<h1 id="headername" class="section-header"><a href="#headername"><code>HeaderName</code></a></h1>
<p>The <code>HeaderName</code> type represents both standard header names as well as
custom header names. The type handles the case insensitive nature of header
names and is used as the key portion of <code>HeaderMap</code>. Header names are
normalized to lower case. In other words, when creating a <code>HeaderName</code> with
a string, even if upper case characters are included, when getting a string
representation of the <code>HeaderName</code>, it will be all lower case. This allows
for faster <code>HeaderMap</code> comparison operations.</p>
<p>The internal representation is optimized to efficiently handle the cases
most commonly encountered when working with HTTP. Standard header names are
special cased and are represented internally as an enum. Short custom
headers will be stored directly in the <code>HeaderName</code> struct and will not
incur any allocation overhead, however longer strings will require an
allocation for storage.</p>
<h2 id="limitations" class="section-header"><a href="#limitations">Limitations</a></h2>
<p><code>HeaderName</code> has a max length of 32,768 for header names. Attempting to
parse longer names will result in a panic.</p>
<h1 id="headermap" class="section-header"><a href="#headermap"><code>HeaderMap</code></a></h1>
<p><code>HeaderMap</code> is a map structure of header names highly optimized for use
cases common with HTTP. It is a <a href="https://en.wikipedia.org/wiki/Multimap">multimap</a> structure, where each header name
may have multiple associated header values. Given this, some of the APIs
diverge from <a href="https://doc.rust-lang.org/std/collections/struct.HashMap.html"><code>HashMap</code></a>.</p>
<h2 id="overview" class="section-header"><a href="#overview">Overview</a></h2>
<p>Just like <code>HashMap</code> in Rust's stdlib, <code>HeaderMap</code> is based on <a href="https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing">Robin Hood
hashing</a>. This algorithm tends to reduce the worst case search times in the
table and enables high load factors without seriously affecting performance.
Internally, keys and values are stored in vectors. As such, each insertion
will not incur allocation overhead. However, once the underlying vector
storage is full, a larger vector must be allocated and all values copied.</p>
<h2 id="deterministic-ordering" class="section-header"><a href="#deterministic-ordering">Deterministic ordering</a></h2>
<p>Unlike Rust's <code>HashMap</code>, values in <code>HeaderMap</code> are deterministically
ordered. Roughly, values are ordered by insertion. This means that a
function that deterministically operates on a header map can rely on the
iteration order to remain consistent across processes and platforms.</p>
<h2 id="adaptive-hashing" class="section-header"><a href="#adaptive-hashing">Adaptive hashing</a></h2>
<p><code>HeaderMap</code> uses an adaptive hashing strategy in order to efficiently handle
most common cases. All standard headers have statically computed hash values
which removes the need to perform any hashing of these headers at runtime.
The default hash function emphasizes performance over robustness. However,
<code>HeaderMap</code> detects high collision rates and switches to a secure hash
function in those events. The threshold is set such that only denial of
service attacks should trigger it.</p>
<h2 id="limitations-1" class="section-header"><a href="#limitations-1">Limitations</a></h2>
<p><code>HeaderMap</code> can store a maximum of 32,768 headers (header name / value
pairs). Attempting to insert more will result in a panic.</p>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.Drain.html" title='http::header::Drain struct'>Drain</a></td><td class='docblock-short'><p>A drain iterator for <code>HeaderMap</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.GetAll.html" title='http::header::GetAll struct'>GetAll</a></td><td class='docblock-short'><p>A view to all values stored in a single entry.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.HeaderMap.html" title='http::header::HeaderMap struct'>HeaderMap</a></td><td class='docblock-short'><p>A set of HTTP headers</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.HeaderName.html" title='http::header::HeaderName struct'>HeaderName</a></td><td class='docblock-short'><p>Represents an HTTP header field name</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.HeaderValue.html" title='http::header::HeaderValue struct'>HeaderValue</a></td><td class='docblock-short'><p>Represents an HTTP header field value.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.IntoIter.html" title='http::header::IntoIter struct'>IntoIter</a></td><td class='docblock-short'><p>An owning iterator over the entries of a <code>HeaderMap</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.InvalidHeaderName.html" title='http::header::InvalidHeaderName struct'>InvalidHeaderName</a></td><td class='docblock-short'><p>A possible error when converting a <code>HeaderName</code> from another type.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.InvalidHeaderNameBytes.html" title='http::header::InvalidHeaderNameBytes struct'>InvalidHeaderNameBytes</a></td><td class='docblock-short'><p>A possible error when converting a <code>HeaderName</code> from another type.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.InvalidHeaderValue.html" title='http::header::InvalidHeaderValue struct'>InvalidHeaderValue</a></td><td class='docblock-short'><p>A possible error when converting a <code>HeaderValue</code> from a string or byte
slice.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.InvalidHeaderValueBytes.html" title='http::header::InvalidHeaderValueBytes struct'>InvalidHeaderValueBytes</a></td><td class='docblock-short'><p>A possible error when converting a <code>HeaderValue</code> from a string or byte
slice.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Iter.html" title='http::header::Iter struct'>Iter</a></td><td class='docblock-short'><p><code>HeaderMap</code> entry iterator.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.IterMut.html" title='http::header::IterMut struct'>IterMut</a></td><td class='docblock-short'><p><code>HeaderMap</code> mutable entry iterator</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Keys.html" title='http::header::Keys struct'>Keys</a></td><td class='docblock-short'><p>An iterator over <code>HeaderMap</code> keys.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.OccupiedEntry.html" title='http::header::OccupiedEntry struct'>OccupiedEntry</a></td><td class='docblock-short'><p>A view into a single occupied location in a <code>HeaderMap</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ToStrError.html" title='http::header::ToStrError struct'>ToStrError</a></td><td class='docblock-short'><p>A possible error when converting a <code>HeaderValue</code> to a string representation.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.VacantEntry.html" title='http::header::VacantEntry struct'>VacantEntry</a></td><td class='docblock-short'><p>A view into a single empty location in a <code>HeaderMap</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ValueDrain.html" title='http::header::ValueDrain struct'>ValueDrain</a></td><td class='docblock-short'><p>An drain iterator of all values associated with a single header name.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ValueIter.html" title='http::header::ValueIter struct'>ValueIter</a></td><td class='docblock-short'><p>An iterator of all values associated with a single header name.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ValueIterMut.html" title='http::header::ValueIterMut struct'>ValueIterMut</a></td><td class='docblock-short'><p>A mutable iterator of all values associated with a single header name.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Values.html" title='http::header::Values struct'>Values</a></td><td class='docblock-short'><p><code>HeaderMap</code> value iterator.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ValuesMut.html" title='http::header::ValuesMut struct'>ValuesMut</a></td><td class='docblock-short'><p><code>HeaderMap</code> mutable value iterator</p>
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table><tr class='module-item'><td><a class="enum" href="enum.Entry.html" title='http::header::Entry enum'>Entry</a></td><td class='docblock-short'><p>A view into a single location in a <code>HeaderMap</code>, which may be vacant or occupied.</p>
</td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
<table><tr class='module-item'><td><a class="constant" href="constant.ACCEPT.html" title='http::header::ACCEPT constant'>ACCEPT</a></td><td class='docblock-short'><p>Advertises which content types the client is able to understand.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCEPT_CHARSET.html" title='http::header::ACCEPT_CHARSET constant'>ACCEPT_CHARSET</a></td><td class='docblock-short'><p>Advertises which character set the client is able to understand.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCEPT_ENCODING.html" title='http::header::ACCEPT_ENCODING constant'>ACCEPT_ENCODING</a></td><td class='docblock-short'><p>Advertises which content encoding the client is able to understand.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCEPT_LANGUAGE.html" title='http::header::ACCEPT_LANGUAGE constant'>ACCEPT_LANGUAGE</a></td><td class='docblock-short'><p>Advertises which languages the client is able to understand.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCEPT_RANGES.html" title='http::header::ACCEPT_RANGES constant'>ACCEPT_RANGES</a></td><td class='docblock-short'><p>Marker used by the server to advertise partial request support.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_CREDENTIALS.html" title='http::header::ACCESS_CONTROL_ALLOW_CREDENTIALS constant'>ACCESS_CONTROL_ALLOW_CREDENTIALS</a></td><td class='docblock-short'><p>Preflight response indicating if the response to the request can be
exposed to the page.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_HEADERS.html" title='http::header::ACCESS_CONTROL_ALLOW_HEADERS constant'>ACCESS_CONTROL_ALLOW_HEADERS</a></td><td class='docblock-short'><p>Preflight response indicating permitted HTTP headers.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_METHODS.html" title='http::header::ACCESS_CONTROL_ALLOW_METHODS constant'>ACCESS_CONTROL_ALLOW_METHODS</a></td><td class='docblock-short'><p>Preflight header response indicating permitted access methods.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_ORIGIN.html" title='http::header::ACCESS_CONTROL_ALLOW_ORIGIN constant'>ACCESS_CONTROL_ALLOW_ORIGIN</a></td><td class='docblock-short'><p>Indicates whether the response can be shared with resources with the
given origin.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_EXPOSE_HEADERS.html" title='http::header::ACCESS_CONTROL_EXPOSE_HEADERS constant'>ACCESS_CONTROL_EXPOSE_HEADERS</a></td><td class='docblock-short'><p>Indicates which headers can be exposed as part of the response by
listing their names.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_MAX_AGE.html" title='http::header::ACCESS_CONTROL_MAX_AGE constant'>ACCESS_CONTROL_MAX_AGE</a></td><td class='docblock-short'><p>Indicates how long the results of a preflight request can be cached.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_REQUEST_HEADERS.html" title='http::header::ACCESS_CONTROL_REQUEST_HEADERS constant'>ACCESS_CONTROL_REQUEST_HEADERS</a></td><td class='docblock-short'><p>Informs the server which HTTP headers will be used when an actual
request is made.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ACCESS_CONTROL_REQUEST_METHOD.html" title='http::header::ACCESS_CONTROL_REQUEST_METHOD constant'>ACCESS_CONTROL_REQUEST_METHOD</a></td><td class='docblock-short'><p>Informs the server know which HTTP method will be used when the actual
request is made.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.AGE.html" title='http::header::AGE constant'>AGE</a></td><td class='docblock-short'><p>Indicates the time in seconds the object has been in a proxy cache.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ALLOW.html" title='http::header::ALLOW constant'>ALLOW</a></td><td class='docblock-short'><p>Lists the set of methods support by a resource.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ALT_SVC.html" title='http::header::ALT_SVC constant'>ALT_SVC</a></td><td class='docblock-short'><p>Advertises the availability of alternate services to clients.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.AUTHORIZATION.html" title='http::header::AUTHORIZATION constant'>AUTHORIZATION</a></td><td class='docblock-short'><p>Contains the credentials to authenticate a user agent with a server.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CACHE_CONTROL.html" title='http::header::CACHE_CONTROL constant'>CACHE_CONTROL</a></td><td class='docblock-short'><p>Specifies directives for caching mechanisms in both requests and
responses.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONNECTION.html" title='http::header::CONNECTION constant'>CONNECTION</a></td><td class='docblock-short'><p>Controls whether or not the network connection stays open after the
current transaction finishes.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_DISPOSITION.html" title='http::header::CONTENT_DISPOSITION constant'>CONTENT_DISPOSITION</a></td><td class='docblock-short'><p>Indicates if the content is expected to be displayed inline.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_ENCODING.html" title='http::header::CONTENT_ENCODING constant'>CONTENT_ENCODING</a></td><td class='docblock-short'><p>Used to compress the media-type.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_LANGUAGE.html" title='http::header::CONTENT_LANGUAGE constant'>CONTENT_LANGUAGE</a></td><td class='docblock-short'><p>Used to describe the languages intended for the audience.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_LENGTH.html" title='http::header::CONTENT_LENGTH constant'>CONTENT_LENGTH</a></td><td class='docblock-short'><p>Indicates the size fo the entity-body.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_LOCATION.html" title='http::header::CONTENT_LOCATION constant'>CONTENT_LOCATION</a></td><td class='docblock-short'><p>Indicates an alternate location for the returned data.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_RANGE.html" title='http::header::CONTENT_RANGE constant'>CONTENT_RANGE</a></td><td class='docblock-short'><p>Indicates where in a full body message a partial message belongs.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_SECURITY_POLICY.html" title='http::header::CONTENT_SECURITY_POLICY constant'>CONTENT_SECURITY_POLICY</a></td><td class='docblock-short'><p>Allows controlling resources the user agent is allowed to load for a
given page.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_SECURITY_POLICY_REPORT_ONLY.html" title='http::header::CONTENT_SECURITY_POLICY_REPORT_ONLY constant'>CONTENT_SECURITY_POLICY_REPORT_ONLY</a></td><td class='docblock-short'><p>Allows experimenting with policies by monitoring their effects.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.CONTENT_TYPE.html" title='http::header::CONTENT_TYPE constant'>CONTENT_TYPE</a></td><td class='docblock-short'><p>Used to indicate the media type of the resource.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.COOKIE.html" title='http::header::COOKIE constant'>COOKIE</a></td><td class='docblock-short'><p>Contains stored HTTP cookies previously sent by the server with the
Set-Cookie header.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.DATE.html" title='http::header::DATE constant'>DATE</a></td><td class='docblock-short'><p>Contains the date and time at which the message was originated.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.DNT.html" title='http::header::DNT constant'>DNT</a></td><td class='docblock-short'><p>Indicates the client's tracking preference.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ETAG.html" title='http::header::ETAG constant'>ETAG</a></td><td class='docblock-short'><p>Identifier for a specific version of a resource.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.EXPECT.html" title='http::header::EXPECT constant'>EXPECT</a></td><td class='docblock-short'><p>Indicates expectations that need to be fulfilled by the server in order
to properly handle the request.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.EXPIRES.html" title='http::header::EXPIRES constant'>EXPIRES</a></td><td class='docblock-short'><p>Contains the date/time after which the response is considered stale.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.FORWARDED.html" title='http::header::FORWARDED constant'>FORWARDED</a></td><td class='docblock-short'><p>Contains information from the client-facing side of proxy servers that
is altered or lost when a proxy is involved in the path of the request.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.FROM.html" title='http::header::FROM constant'>FROM</a></td><td class='docblock-short'><p>Contains an Internet email address for a human user who controls the
requesting user agent.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.HOST.html" title='http::header::HOST constant'>HOST</a></td><td class='docblock-short'><p>Specifies the domain name of the server and (optionally) the TCP port
number on which the server is listening.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IF_MATCH.html" title='http::header::IF_MATCH constant'>IF_MATCH</a></td><td class='docblock-short'><p>Makes a request conditional based on the E-Tag.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IF_MODIFIED_SINCE.html" title='http::header::IF_MODIFIED_SINCE constant'>IF_MODIFIED_SINCE</a></td><td class='docblock-short'><p>Makes a request conditional based on the modification date.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IF_NONE_MATCH.html" title='http::header::IF_NONE_MATCH constant'>IF_NONE_MATCH</a></td><td class='docblock-short'><p>Makes a request conditional based on the E-Tag.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IF_RANGE.html" title='http::header::IF_RANGE constant'>IF_RANGE</a></td><td class='docblock-short'><p>Makes a request conditional based on range.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IF_UNMODIFIED_SINCE.html" title='http::header::IF_UNMODIFIED_SINCE constant'>IF_UNMODIFIED_SINCE</a></td><td class='docblock-short'><p>Makes the request conditional based on the last modification date.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.LAST_MODIFIED.html" title='http::header::LAST_MODIFIED constant'>LAST_MODIFIED</a></td><td class='docblock-short'><p>Content-Types that are acceptable for the response.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.LINK.html" title='http::header::LINK constant'>LINK</a></td><td class='docblock-short'><p>Allows the server to point an interested client to another resource
containing metadata about the requested resource.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.LOCATION.html" title='http::header::LOCATION constant'>LOCATION</a></td><td class='docblock-short'><p>Indicates the URL to redirect a page to.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.MAX_FORWARDS.html" title='http::header::MAX_FORWARDS constant'>MAX_FORWARDS</a></td><td class='docblock-short'><p>Indicates the max number of intermediaries the request should be sent
through.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.ORIGIN.html" title='http::header::ORIGIN constant'>ORIGIN</a></td><td class='docblock-short'><p>Indicates where a fetch originates from.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.PRAGMA.html" title='http::header::PRAGMA constant'>PRAGMA</a></td><td class='docblock-short'><p>HTTP/1.0 header usually used for backwards compatibility.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.PROXY_AUTHENTICATE.html" title='http::header::PROXY_AUTHENTICATE constant'>PROXY_AUTHENTICATE</a></td><td class='docblock-short'><p>Defines the authentication method that should be used to gain access to
a proxy.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.PROXY_AUTHORIZATION.html" title='http::header::PROXY_AUTHORIZATION constant'>PROXY_AUTHORIZATION</a></td><td class='docblock-short'><p>Contains the credentials to authenticate a user agent to a proxy server.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.PUBLIC_KEY_PINS.html" title='http::header::PUBLIC_KEY_PINS constant'>PUBLIC_KEY_PINS</a></td><td class='docblock-short'><p>Associates a specific cryptographic public key with a certain server.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.PUBLIC_KEY_PINS_REPORT_ONLY.html" title='http::header::PUBLIC_KEY_PINS_REPORT_ONLY constant'>PUBLIC_KEY_PINS_REPORT_ONLY</a></td><td class='docblock-short'><p>Sends reports of pinning violation to the report-uri specified in the
header.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.RANGE.html" title='http::header::RANGE constant'>RANGE</a></td><td class='docblock-short'><p>Indicates the part of a document that the server should return.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.REFERER.html" title='http::header::REFERER constant'>REFERER</a></td><td class='docblock-short'><p>Contains the address of the previous web page from which a link to the
currently requested page was followed.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.REFERRER_POLICY.html" title='http::header::REFERRER_POLICY constant'>REFERRER_POLICY</a></td><td class='docblock-short'><p>Governs which referrer information should be included with requests
made.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.REFRESH.html" title='http::header::REFRESH constant'>REFRESH</a></td><td class='docblock-short'><p>Informs the web browser that the current page or frame should be
refreshed.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.RETRY_AFTER.html" title='http::header::RETRY_AFTER constant'>RETRY_AFTER</a></td><td class='docblock-short'><p>The Retry-After response HTTP header indicates how long the user agent
should wait before making a follow-up request. There are two main cases
this header is used:</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SEC_WEBSOCKET_ACCEPT.html" title='http::header::SEC_WEBSOCKET_ACCEPT constant'>SEC_WEBSOCKET_ACCEPT</a></td><td class='docblock-short'><p>The |Sec-WebSocket-Accept| header field is used in the WebSocket
opening handshake. It is sent from the server to the client to
confirm that the server is willing to initiate the WebSocket
connection.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SEC_WEBSOCKET_EXTENSIONS.html" title='http::header::SEC_WEBSOCKET_EXTENSIONS constant'>SEC_WEBSOCKET_EXTENSIONS</a></td><td class='docblock-short'><p>The |Sec-WebSocket-Extensions| header field is used in the WebSocket
opening handshake. It is initially sent from the client to the
server, and then subsequently sent from the server to the client, to
agree on a set of protocol-level extensions to use for the duration
of the connection.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SEC_WEBSOCKET_KEY.html" title='http::header::SEC_WEBSOCKET_KEY constant'>SEC_WEBSOCKET_KEY</a></td><td class='docblock-short'><p>The |Sec-WebSocket-Key| header field is used in the WebSocket opening
handshake. It is sent from the client to the server to provide part
of the information used by the server to prove that it received a
valid WebSocket opening handshake. This helps ensure that the server
does not accept connections from non-WebSocket clients (e.g., HTTP
clients) that are being abused to send data to unsuspecting WebSocket
servers.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SEC_WEBSOCKET_PROTOCOL.html" title='http::header::SEC_WEBSOCKET_PROTOCOL constant'>SEC_WEBSOCKET_PROTOCOL</a></td><td class='docblock-short'><p>The |Sec-WebSocket-Protocol| header field is used in the WebSocket
opening handshake. It is sent from the client to the server and back
from the server to the client to confirm the subprotocol of the
connection. This enables scripts to both select a subprotocol and be
sure that the server agreed to serve that subprotocol.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SEC_WEBSOCKET_VERSION.html" title='http::header::SEC_WEBSOCKET_VERSION constant'>SEC_WEBSOCKET_VERSION</a></td><td class='docblock-short'><p>The |Sec-WebSocket-Version| header field is used in the WebSocket
opening handshake. It is sent from the client to the server to
indicate the protocol version of the connection. This enables
servers to correctly interpret the opening handshake and subsequent
data being sent from the data, and close the connection if the server
cannot interpret that data in a safe manner.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SERVER.html" title='http::header::SERVER constant'>SERVER</a></td><td class='docblock-short'><p>Contains information about the software used by the origin server to
handle the request.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SET_COOKIE.html" title='http::header::SET_COOKIE constant'>SET_COOKIE</a></td><td class='docblock-short'><p>Used to send cookies from the server to the user agent.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.STRICT_TRANSPORT_SECURITY.html" title='http::header::STRICT_TRANSPORT_SECURITY constant'>STRICT_TRANSPORT_SECURITY</a></td><td class='docblock-short'><p>Tells the client to communicate with HTTPS instead of using HTTP.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.TE.html" title='http::header::TE constant'>TE</a></td><td class='docblock-short'><p>Informs the server of transfer encodings willing to be accepted as part
of the response.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.TRAILER.html" title='http::header::TRAILER constant'>TRAILER</a></td><td class='docblock-short'><p>Allows the sender to include additional fields at the end of chunked
messages.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.TRANSFER_ENCODING.html" title='http::header::TRANSFER_ENCODING constant'>TRANSFER_ENCODING</a></td><td class='docblock-short'><p>Specifies the form of encoding used to safely transfer the entity to the
client.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.UPGRADE.html" title='http::header::UPGRADE constant'>UPGRADE</a></td><td class='docblock-short'><p>Used as part of the exchange to upgrade the protocol.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.UPGRADE_INSECURE_REQUESTS.html" title='http::header::UPGRADE_INSECURE_REQUESTS constant'>UPGRADE_INSECURE_REQUESTS</a></td><td class='docblock-short'><p>Sends a signal to the server expressing the clients preference for an
encrypted and authenticated response.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.USER_AGENT.html" title='http::header::USER_AGENT constant'>USER_AGENT</a></td><td class='docblock-short'><p>Contains a string that allows identifying the requesting client's
software.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.VARY.html" title='http::header::VARY constant'>VARY</a></td><td class='docblock-short'><p>Determines how to match future requests with cached responses.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.VIA.html" title='http::header::VIA constant'>VIA</a></td><td class='docblock-short'><p>Added by proxies to track routing.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.WARNING.html" title='http::header::WARNING constant'>WARNING</a></td><td class='docblock-short'><p>General HTTP header contains information about possible problems with
the status of the message.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.WWW_AUTHENTICATE.html" title='http::header::WWW_AUTHENTICATE constant'>WWW_AUTHENTICATE</a></td><td class='docblock-short'><p>Defines the authentication method that should be used to gain access to
a resource.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.X_CONTENT_TYPE_OPTIONS.html" title='http::header::X_CONTENT_TYPE_OPTIONS constant'>X_CONTENT_TYPE_OPTIONS</a></td><td class='docblock-short'><p>Marker used by the server to indicate that the MIME types advertised in
the <code>content-type</code> headers should not be changed and be followed.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.X_DNS_PREFETCH_CONTROL.html" title='http::header::X_DNS_PREFETCH_CONTROL constant'>X_DNS_PREFETCH_CONTROL</a></td><td class='docblock-short'><p>Controls DNS prefetching.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.X_FRAME_OPTIONS.html" title='http::header::X_FRAME_OPTIONS constant'>X_FRAME_OPTIONS</a></td><td class='docblock-short'><p>Indicates whether or not a browser should be allowed to render a page in
a frame.</p>
</td></tr><tr class='module-item'><td><a class="constant" href="constant.X_XSS_PROTECTION.html" title='http::header::X_XSS_PROTECTION constant'>X_XSS_PROTECTION</a></td><td class='docblock-short'><p>Stop pages from loading when an XSS attack is detected.</p>
</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
<table><tr class='module-item'><td><a class="trait" href="trait.AsHeaderName.html" title='http::header::AsHeaderName trait'>AsHeaderName</a></td><td class='docblock-short'><p>A marker trait used to identify values that can be used as search keys
to a <code>HeaderMap</code>.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.IntoHeaderName.html" title='http::header::IntoHeaderName trait'>IntoHeaderName</a></td><td class='docblock-short'><p>A marker trait used to identify values that can be used as insert keys
to a <code>HeaderMap</code>.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "http";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>