Enum afire::header::HeaderType
source · pub enum HeaderType {
Show 21 variants
Accept,
AcceptCharset,
AcceptEncoding,
AcceptLanguage,
Connection,
ContentEncoding,
ContentLength,
ContentType,
Cookie,
Date,
Host,
Location,
Referer,
Server,
SetCookie,
TransferEncoding,
Upgrade,
UserAgent,
Via,
XForwardedFor,
Custom(String),
}
Expand description
Common HTTP headers. Just the ‘common’ ones, which are ones that I use semi-frequently, or that are used internally.
Variants§
Accept
Indicates what content types (MIME types) are acceptable for the client. (MDN)
AcceptCharset
Indicates what character sets are acceptable for the client. (MDN)
AcceptEncoding
Indicates what content encodings (usually compression algorithms) are acceptable for the client. (MDN)
AcceptLanguage
Indicates what languages are acceptable for the client. (MDN)
Connection
Allows re-using a socket for multiple requests with keep-alive
, or closing the sockets with close
.
(MDN)
ContentEncoding
Lists the encodings that have been applied to the entity body.
See HeaderType::AcceptEncoding
(MDN)
ContentLength
An integer indicating the size of the entity body in bytes. This is only required when the body is not chunked. (MDN)
ContentType
Indicates the media type of the entity body.
This can be set on a response with the crate::Response::content
method.
(MDN)
Cookie
Contains cookies from the client. (MDN)
Date
The date and time at which the message was originated. (MDN)
Host
Sent with requests to indicate the host and port of the server to which the request is being sent. This allows for reverse proxies to forward requests to the correct server. (MDN)
Location
Used with redirection status codes (301, 302, 303, 307, 308) to indicate the URL to redirect to. (MDN)
Referer
Contains the address of the webpage that linked to the resource being requested. Note the misspelling of referrer as ‘referer’ in the HTTP spec. (MDN)
Server
An identifier for a specific name / version of the web server software.
This is set to afire/VERSION
by default.
(MDN)
SetCookie
Used to send cookies from the server to the client.
Its recommended to use the crate::SetCookie
builder instead of this directly.
(MDN)
TransferEncoding
Specifies the transfer encoding of the message body. (MDN)
Upgrade
Used to switch from HTTP to a different protocol on the same socket, often used for websockets. Note that afire currently does not have built-in support for websockets. (MDN)
UserAgent
Contains information about the client application, operating system, vendor, etc. that is making the request. (MDN)
Via
A header added by proxies to track message forewords, avoid request loops, and identifying protocol capabilities. (MDN)
XForwardedFor
A header often added by reverse proxies to allow web servers to know from which IP a request is originating. This is not an official HTTP header, but is still widely used. (MDN)
Custom(String)
Any other header that is not in this enum.
Trait Implementations§
source§impl Clone for HeaderType
impl Clone for HeaderType
source§fn clone(&self) -> HeaderType
fn clone(&self) -> HeaderType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HeaderType
impl Debug for HeaderType
source§impl Display for HeaderType
impl Display for HeaderType
source§impl From<&HeaderType> for HeaderType
impl From<&HeaderType> for HeaderType
source§fn from(s: &HeaderType) -> Self
fn from(s: &HeaderType) -> Self
source§impl Hash for HeaderType
impl Hash for HeaderType
source§impl PartialEq<HeaderType> for HeaderType
impl PartialEq<HeaderType> for HeaderType
source§fn eq(&self, other: &HeaderType) -> bool
fn eq(&self, other: &HeaderType) -> bool
self
and other
values to be equal, and is used
by ==
.