Expand description
Pre-defined HeaderNames, traits for parsing and conversion, and other header utility methods.
Re-exports§
- pub use self::map::HeaderMap;
Modules§
Structs§
- ExtendedValue 
- The value part of an extended parameter consisting of three parts:
- HeaderName 
- Represents an HTTP header field name
- HeaderValue 
- Represents an HTTP header field value.
- HttpDate 
- A timestamp with HTTP-style formatting and parsing.
- InvalidHeader Name 
- A possible error when converting a HeaderNamefrom another type.
- InvalidHeader Value 
- A possible error when converting a HeaderValuefrom a string or byte slice.
- LanguageTag 
- A language tag as described in RFC 5646.
- Quality
- Represents a quality used in q-factor values.
- QualityItem 
- Represents an item with a quality value as defined in RFC 7231 §5.3.1.
- ToStrError 
- A possible error when converting a HeaderValueto a string representation.
Enums§
- Charset
- A MIME character set.
- ContentEncoding 
- Represents a supported content encoding.
Constants§
- ACCEPT
- Advertises which content types the client is able to understand.
- ACCEPT_CHARSET 
- Advertises which character set the client is able to understand.
- ACCEPT_ENCODING 
- Advertises which content encoding the client is able to understand.
- ACCEPT_LANGUAGE 
- Advertises which languages the client is able to understand.
- ACCEPT_RANGES 
- Marker used by the server to advertise partial request support.
- ACCESS_CONTROL_ ALLOW_ CREDENTIALS 
- Preflight response indicating if the response to the request can be exposed to the page.
- ACCESS_CONTROL_ ALLOW_ HEADERS 
- Preflight response indicating permitted HTTP headers.
- ACCESS_CONTROL_ ALLOW_ METHODS 
- Preflight header response indicating permitted access methods.
- ACCESS_CONTROL_ ALLOW_ ORIGIN 
- Indicates whether the response can be shared with resources with the given origin.
- ACCESS_CONTROL_ EXPOSE_ HEADERS 
- Indicates which headers can be exposed as part of the response by listing their names.
- ACCESS_CONTROL_ MAX_ AGE 
- Indicates how long the results of a preflight request can be cached.
- ACCESS_CONTROL_ REQUEST_ HEADERS 
- Informs the server which HTTP headers will be used when an actual request is made.
- ACCESS_CONTROL_ REQUEST_ METHOD 
- Informs the server know which HTTP method will be used when the actual request is made.
- AGE
- Indicates the time in seconds the object has been in a proxy cache.
- ALLOW
- Lists the set of methods support by a resource.
- ALT_SVC
- Advertises the availability of alternate services to clients.
- AUTHORIZATION
- Contains the credentials to authenticate a user agent with a server.
- CACHE_CONTROL 
- Specifies directives for caching mechanisms in both requests and responses.
- CACHE_STATUS 
- Response header field that indicates how caches have handled that response and its corresponding request.
- CDN_CACHE_ CONTROL 
- Response header field that allows origin servers to control the behavior of CDN caches interposed between them and clients separately from other caches that might handle the response.
- CLEAR_SITE_ DATA 
- Response header field that sends a signal to the user agent that it ought to remove all data of a certain set of types.
- CONNECTION
- Controls whether or not the network connection stays open after the current transaction finishes.
- CONTENT_DISPOSITION 
- Indicates if the content is expected to be displayed inline.
- CONTENT_ENCODING 
- Used to compress the media-type.
- CONTENT_LANGUAGE 
- Used to describe the languages intended for the audience.
- CONTENT_LENGTH 
- Indicates the size of the entity-body.
- CONTENT_LOCATION 
- Indicates an alternate location for the returned data.
- CONTENT_RANGE 
- Indicates where in a full body message a partial message belongs.
- CONTENT_SECURITY_ POLICY 
- Allows controlling resources the user agent is allowed to load for a given page.
- CONTENT_SECURITY_ POLICY_ REPORT_ ONLY 
- Allows experimenting with policies by monitoring their effects.
- CONTENT_TYPE 
- Used to indicate the media type of the resource.
- COOKIE
- Contains stored HTTP cookies previously sent by the server with the Set-Cookie header.
- CROSS_ORIGIN_ EMBEDDER_ POLICY 
- Response header that prevents a document from loading any cross-origin resources that don’t explicitly grant the document permission (using CORP or CORS).
- CROSS_ORIGIN_ OPENER_ POLICY 
- Response header that allows you to ensure a top-level document does not share a browsing context group with cross-origin documents.
- CROSS_ORIGIN_ RESOURCE_ POLICY 
- Response header that conveys a desire that the browser blocks no-cors cross-origin/cross-site requests to the given resource.
- DATE
- Contains the date and time at which the message was originated.
- DNT
- Indicates the client’s tracking preference.
- ETAG
- Identifier for a specific version of a resource.
- EXPECT
- Indicates expectations that need to be fulfilled by the server in order to properly handle the request.
- EXPIRES
- Contains the date/time after which the response is considered stale.
- FORWARDED
- 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.
- FROM
- Contains an Internet email address for a human user who controls the requesting user agent.
- HOST
- Specifies the domain name of the server and (optionally) the TCP port number on which the server is listening.
- IF_MATCH 
- Makes a request conditional based on the E-Tag.
- IF_MODIFIED_ SINCE 
- Makes a request conditional based on the modification date.
- IF_NONE_ MATCH 
- Makes a request conditional based on the E-Tag.
- IF_RANGE 
- Makes a request conditional based on range.
- IF_UNMODIFIED_ SINCE 
- Makes the request conditional based on the last modification date.
- LAST_MODIFIED 
- Content-Types that are acceptable for the response.
- LINK
- Allows the server to point an interested client to another resource containing metadata about the requested resource.
- LOCATION
- Indicates the URL to redirect a page to.
- MAX_FORWARDS 
- Indicates the max number of intermediaries the request should be sent through.
- ORIGIN
- Indicates where a fetch originates from.
- PERMISSIONS_POLICY 
- Response header that provides a mechanism to allow and deny the use of browser features in a
document or within any <iframe>elements in the document.
- PRAGMA
- HTTP/1.0 header usually used for backwards compatibility.
- PROXY_AUTHENTICATE 
- Defines the authentication method that should be used to gain access to a proxy.
- PROXY_AUTHORIZATION 
- Contains the credentials to authenticate a user agent to a proxy server.
- PUBLIC_KEY_ PINS 
- Associates a specific cryptographic public key with a certain server.
- PUBLIC_KEY_ PINS_ REPORT_ ONLY 
- Sends reports of pinning violation to the report-uri specified in the header.
- RANGE
- Indicates the part of a document that the server should return.
- REFERER
- Contains the address of the previous web page from which a link to the currently requested page was followed.
- REFERRER_POLICY 
- Governs which referrer information should be included with requests made.
- REFRESH
- Informs the web browser that the current page or frame should be refreshed.
- RETRY_AFTER 
- 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:
- SEC_WEBSOCKET_ ACCEPT 
- 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.
- SEC_WEBSOCKET_ EXTENSIONS 
- 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.
- SEC_WEBSOCKET_ KEY 
- 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.
- SEC_WEBSOCKET_ PROTOCOL 
- 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.
- SEC_WEBSOCKET_ VERSION 
- 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.
- SERVER
- Contains information about the software used by the origin server to handle the request.
- SET_COOKIE 
- Used to send cookies from the server to the user agent.
- STRICT_TRANSPORT_ SECURITY 
- Tells the client to communicate with HTTPS instead of using HTTP.
- TE
- Informs the server of transfer encodings willing to be accepted as part of the response.
- TRAILER
- Allows the sender to include additional fields at the end of chunked messages.
- TRANSFER_ENCODING 
- Specifies the form of encoding used to safely transfer the entity to the client.
- UPGRADE
- Used as part of the exchange to upgrade the protocol.
- UPGRADE_INSECURE_ REQUESTS 
- Sends a signal to the server expressing the client’s preference for an encrypted and authenticated response.
- USER_AGENT 
- Contains a string that allows identifying the requesting client’s software.
- VARY
- Determines how to match future requests with cached responses.
- VIA
- Added by proxies to track routing.
- WARNING
- General HTTP header contains information about possible problems with the status of the message.
- WWW_AUTHENTICATE 
- Defines the authentication method that should be used to gain access to a resource.
- X_CONTENT_ TYPE_ OPTIONS 
- Marker used by the server to indicate that the MIME types advertised in
the content-typeheaders should not be changed and be followed.
- X_DNS_ PREFETCH_ CONTROL 
- Controls DNS prefetching.
- X_FORWARDED_ FOR 
- Request header (de-facto standard) for identifying the originating IP address of a client connecting to a web server through a proxy server.
- X_FORWARDED_ HOST 
- Request header (de-facto standard) for identifying the original host requested by the client in
the HostHTTP request header.
- X_FORWARDED_ PROTO 
- Request header (de-facto standard) for identifying the protocol that a client used to connect to your proxy or load balancer.
- X_FRAME_ OPTIONS 
- Indicates whether or not a browser should be allowed to render a page in a frame.
- X_XSS_ PROTECTION 
- Stop pages from loading when an XSS attack is detected.
Traits§
- AsHeaderName 
- Sealed trait implemented for types that can be effectively borrowed as a HeaderValue.
- Header
- An interface for types that already represent a valid header.
- TryIntoHeader Pair 
- An interface for types that can be converted into a HeaderName+HeaderValuepair for insertion into aHeaderMap.
- TryIntoHeader Value 
- An interface for types that can be converted into a HeaderValue.
Functions§
- fmt_comma_ delimited 
- Format an array into a comma-delimited string.
- from_comma_ delimited 
- Reads a comma-delimited raw header into a Vec.
- from_one_ raw_ str 
- Reads a single string when parsing a header.
- http_percent_ encode 
- Percent encode a sequence of bytes with a character set defined in RFC 5987 §3.2.
- parse_extended_ value 
- Parses extended header parameter values (ext-value), as defined in RFC 5987 §3.2.
- q
- Convenience function to create a Qualityfrom anf32(0.0–1.0).