etag() = {weak | strong, binary()}
media_type() = {binary(), binary(), [{binary(), binary()}]}
qvalue() = 0..1000
websocket_version() = 0..255
| access_control_allow_credentials/0 | Build the Access-Control-Allow-Credentials header. |
| access_control_allow_headers/1 | Build the Access-Control-Allow-Headers header. |
| access_control_allow_methods/1 | Build the Access-Control-Allow-Methods header. |
| access_control_allow_origin/1 | Build the Access-Control-Allow-Origin header. |
| access_control_expose_headers/1 | Build the Access-Control-Expose-Headers header. |
| access_control_max_age/1 | Build the Access-Control-Max-Age header. |
| parse_accept/1 | Parse the Accept header. |
| parse_accept_charset/1 | Parse the Accept-Charset header. |
| parse_accept_encoding/1 | Parse the Accept-Encoding header. |
| parse_accept_language/1 | Parse the Accept-Language header. |
| parse_accept_ranges/1 | Parse the Accept-Ranges header. |
| parse_access_control_request_headers/1 | Parse the Access-Control-Request-Headers header. |
| parse_access_control_request_method/1 | Parse the Access-Control-Request-Method header. |
| parse_age/1 | Parse the Age header. |
| parse_allow/1 | Parse the Allow header. |
| parse_authorization/1 | Parse the Authorization header. |
| parse_cache_control/1 | Parse the Cache-Control header. |
| parse_connection/1 | Parse the Connection header. |
| parse_content_encoding/1 | Parse the Content-Encoding header. |
| parse_content_language/1 | Parse the Content-Language header. |
| parse_content_length/1 | Parse the Content-Length header. |
| parse_content_range/1 | Parse the Content-Range header. |
| parse_content_type/1 | Parse the Content-Type header. |
| parse_date/1 | Parse the Date header. |
| parse_etag/1 | Parse the ETag header. |
| parse_expect/1 | Parse the Expect header. |
| parse_expires/1 | Parse the Expires header. |
| parse_host/1 | Parse the Host header. |
| parse_http2_settings/1 | Parse the HTTP2-Settings header. |
| parse_if_match/1 | Parse the If-Match header. |
| parse_if_modified_since/1 | Parse the If-Modified-Since header. |
| parse_if_none_match/1 | Parse the If-None-Match header. |
| parse_if_range/1 | Parse the If-Range header. |
| parse_if_unmodified_since/1 | Parse the If-Unmodified-Since header. |
| parse_last_modified/1 | Parse the Last-Modified header. |
| parse_max_forwards/1 | Parse the Max-Forwards header. |
| parse_origin/1 | Parse the Origin header. |
| parse_pragma/1 | Parse the Pragma header. |
| parse_proxy_authenticate/1 | Parse the Proxy-Authenticate header. |
| parse_proxy_authorization/1 | Parse the Proxy-Authorization header. |
| parse_range/1 | Parse the Range header. |
| parse_retry_after/1 | Parse the Retry-After header. |
| parse_sec_websocket_accept/1 | Dummy parsing function for the Sec-WebSocket-Accept header. |
| parse_sec_websocket_extensions/1 | Parse the Sec-WebSocket-Extensions request header. |
| parse_sec_websocket_key/1 | Dummy parsing function for the Sec-WebSocket-Key header. |
| parse_sec_websocket_protocol_req/1 | Parse the Sec-WebSocket-Protocol request header. |
| parse_sec_websocket_protocol_resp/1 | Parse the Sec-Websocket-Protocol response header. |
| parse_sec_websocket_version_req/1 | Parse the Sec-WebSocket-Version request header. |
| parse_sec_websocket_version_resp/1 | Parse the Sec-WebSocket-Version response header. |
| parse_te/1 | Parse the TE header. |
| parse_trailer/1 | Parse the Trailer header. |
| parse_transfer_encoding/1 | Parse the Transfer-Encoding header. |
| parse_upgrade/1 | Parse the Upgrade header. |
| parse_vary/1 | Parse the Vary header. |
| parse_www_authenticate/1 | Parse the WWW-Authenticate header. |
| parse_x_forwarded_for/1 | Parse the X-Forwarded-For header. |
access_control_allow_credentials() -> iodata()
Build the Access-Control-Allow-Credentials header.
access_control_allow_headers(Headers::[binary()]) -> iodata()
Build the Access-Control-Allow-Headers header.
access_control_allow_methods(Methods::[binary()]) -> iodata()
Build the Access-Control-Allow-Methods header.
access_control_allow_origin(Ref::{binary(), binary(), 0..65535} | reference() | '*') -> iodata()
Build the Access-Control-Allow-Origin header.
access_control_expose_headers(Headers::[binary()]) -> iodata()
Build the Access-Control-Expose-Headers header.
access_control_max_age(MaxAge::non_neg_integer()) -> iodata()
Build the Access-Control-Max-Age header.
parse_accept(Accept::binary()) -> [{media_type(), qvalue(), [binary() | {binary(), binary()}]}]
Parse the Accept header.
parse_accept_charset(Charset::binary()) -> [{binary(), qvalue()}]
Parse the Accept-Charset header.
parse_accept_encoding(Encoding::binary()) -> [{binary(), qvalue()}]
Parse the Accept-Encoding header.
parse_accept_language(LanguageRange::binary()) -> [{binary(), qvalue()}]
Parse the Accept-Language header.
parse_accept_ranges(AcceptRanges::binary()) -> [binary()]
Parse the Accept-Ranges header.
parse_access_control_request_headers(Headers::binary()) -> [binary()]
Parse the Access-Control-Request-Headers header.
parse_access_control_request_method(Method::binary()) -> binary()
Parse the Access-Control-Request-Method header.
parse_age(Age::binary()) -> non_neg_integer()
Parse the Age header.
parse_allow(Allow::binary()) -> [binary()]
Parse the Allow header.
parse_authorization(X1::binary()) -> {basic, binary(), binary()} | {bearer, binary()} | {digest, [{binary(), binary()}]}
Parse the Authorization header.
We support Basic, Digest and Bearer schemes only.
In the Digest case we do not validate that the mandatory fields are present. When parsing auth-params, we do not accept BWS characters around the "=".parse_cache_control(CacheControl::binary()) -> [binary() | {binary(), binary()} | {binary(), non_neg_integer()} | {binary(), [binary()]}]
Parse the Cache-Control header.
In the fields list case, we do not support escaping, which shouldn't be needed anyway.parse_connection(Connection::binary()) -> [binary()]
Parse the Connection header.
parse_content_encoding(ContentEncoding::binary()) -> [binary()]
Parse the Content-Encoding header.
parse_content_language(ContentLanguage::binary()) -> [binary()]
Parse the Content-Language header.
We do not support irregular deprecated tags that do not match the ABNF.parse_content_length(ContentLength::binary()) -> non_neg_integer()
Parse the Content-Length header.
parse_content_range(X1::binary()) -> {bytes, non_neg_integer(), non_neg_integer(), non_neg_integer() | '*'} | {bytes, '*', non_neg_integer()} | {binary(), binary()}
Parse the Content-Range header.
parse_content_type(X1::binary()) -> media_type()
Parse the Content-Type header.
parse_date(Date::binary()) -> calendar:datetime()
Parse the Date header.
parse_etag(X1::binary()) -> etag()
Parse the ETag header.
parse_expect(X1::binary()) -> continue
Parse the Expect header.
parse_expires(Expires::binary()) -> calendar:datetime()
Parse the Expires header.
Recipients must interpret invalid date formats as a date in the past. The value "0" is commonly used.parse_host(Host::binary()) -> {binary(), 0..65535 | undefined}
Parse the Host header.
We only seek to have legal characters and separate the host and port values. The number of segments in the host or the size of each segment is not checked.
There is no way to distinguish IPv4 addresses from regular names until the last segment is reached therefore we do not differentiate them.
The following valid hosts are currently rejected: IPv6 addresses with a zone identifier; IPvFuture addresses; and percent-encoded addresses.parse_http2_settings(HTTP2Settings::binary()) -> map()
Parse the HTTP2-Settings header.
parse_if_match(IfMatch::binary()) -> '*' | [etag()]
Parse the If-Match header.
parse_if_modified_since(IfModifiedSince::binary()) -> calendar:datetime()
Parse the If-Modified-Since header.
parse_if_none_match(IfNoneMatch::binary()) -> '*' | [etag()]
Parse the If-None-Match header.
parse_if_range(IfRange::binary()) -> etag() | calendar:datetime()
Parse the If-Range header.
parse_if_unmodified_since(IfModifiedSince::binary()) -> calendar:datetime()
Parse the If-Unmodified-Since header.
parse_last_modified(LastModified::binary()) -> calendar:datetime()
Parse the Last-Modified header.
parse_max_forwards(MaxForwards::binary()) -> non_neg_integer()
Parse the Max-Forwards header.
parse_origin(Origins::binary()) -> [{binary(), binary(), 0..65535} | reference()]
Parse the Origin header.
parse_pragma(X1::binary()) -> cache | no_cache
Parse the Pragma header.
Legacy header kept for backward compatibility with HTTP/1.0 caches. Only the "no-cache" directive was ever specified, and only for request messages.
We take a large shortcut in the parsing of this header, expecting an exact match of "no-cache".parse_proxy_authenticate(ProxyAuthenticate::binary()) -> [{basic, binary()} | {bearer | digest | binary(), [{binary(), binary()}]}]
Parse the Proxy-Authenticate header.
Alias of parse_www_authenticate/1 due to identical syntax.parse_proxy_authorization(ProxyAuthorization::binary()) -> {basic, binary(), binary()} | {bearer, binary()} | {digest, [{binary(), binary()}]}
Parse the Proxy-Authorization header.
Alias of parse_authorization/1 due to identical syntax.parse_range(X1::binary()) -> {bytes, [{non_neg_integer(), non_neg_integer() | infinity} | neg_integer()]} | {binary(), binary()}
Parse the Range header.
parse_retry_after(RetryAfter::binary()) -> non_neg_integer() | calendar:datetime()
Parse the Retry-After header.
parse_sec_websocket_accept(SecWebSocketAccept::binary()) -> binary()
Dummy parsing function for the Sec-WebSocket-Accept header.
The argument is returned without any processing. This value is expected to be matched directly by the client so no parsing is needed.parse_sec_websocket_extensions(SecWebSocketExtensions::binary()) -> [{binary(), [binary() | {binary(), binary()}]}]
Parse the Sec-WebSocket-Extensions request header.
parse_sec_websocket_key(SecWebSocketKey::binary()) -> binary()
Dummy parsing function for the Sec-WebSocket-Key header.
The argument is returned without any processing. This value is expected to be prepended to a static value, the result of which hashed to form a new base64 value returned in Sec-WebSocket-Accept, therefore no parsing is needed.parse_sec_websocket_protocol_req(SecWebSocketProtocol::binary()) -> [binary()]
Parse the Sec-WebSocket-Protocol request header.
parse_sec_websocket_protocol_resp(Protocol::binary()) -> binary()
Parse the Sec-Websocket-Protocol response header.
parse_sec_websocket_version_req(SecWebSocketVersion::binary()) -> websocket_version()
Parse the Sec-WebSocket-Version request header.
parse_sec_websocket_version_resp(SecWebSocketVersion::binary()) -> [websocket_version()]
Parse the Sec-WebSocket-Version response header.
parse_te(TE::binary()) -> {trailers | no_trailers, [{binary(), qvalue()}]}
Parse the TE header.
This function does not support parsing of transfer-parameter.parse_trailer(Trailer::binary()) -> [binary()]
Parse the Trailer header.
parse_transfer_encoding(TransferEncoding::binary()) -> [binary()]
Parse the Transfer-Encoding header.
This function does not support parsing of transfer-parameter.parse_upgrade(Upgrade::binary()) -> [binary()]
Parse the Upgrade header.
It is unclear from the RFC whether the values here are case sensitive.
We handle them in a case insensitive manner because they are described as case insensitive in the Websocket RFC.parse_vary(Vary::binary()) -> '*' | [binary()]
Parse the Vary header.
parse_www_authenticate(Authenticate::binary()) -> [{basic, binary()} | {bearer | digest | binary(), [{binary(), binary()}]}]
Parse the WWW-Authenticate header.
Unknown schemes are represented as the lowercase binary instead of an atom. Unlike with parse_authorization/1, we do not crash on unknown schemes.
When parsing auth-params, we do not accept BWS characters around the "=".parse_x_forwarded_for(XForwardedFor::binary()) -> [binary()]
Parse the X-Forwarded-For header.
This header has no specification but *looks like* it is a list of tokens.
This header is deprecated in favor of the Forwarded header.Generated by EDoc