Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module provides Attoparsec-based parsers for the HTTP grammar rules as defined by RFC-2616.
- data UserAgent
- data Product = Product {}
- userAgent :: Parser [UserAgent]
- product :: Parser Product
- comment :: Parser ByteString
- ctext :: Word8 -> Bool
- quotedPair :: Parser Word8
- text :: Word8 -> Bool
- char :: Word8 -> Bool
- ctl :: Word8 -> Bool
- token :: Parser ByteString
- separators :: Word8 -> Bool
- lws :: Parser ()
- crlf :: Parser ()
Parsable data types.
The User-Agent header field is defined as a list of tokens, each of which is either a product or a comment. Values of this data type represents one such token.
A representation of an HTTP User-Agent product. https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.8
Productions
userAgent :: Parser [UserAgent] Source #
Parser for the User-Agent header, defined: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
product :: Parser Product Source #
product - http product token. https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.8
comment :: Parser ByteString Source #
comment - basic http grammar rule. The result is the parsed comment content, rather than the raw source.
ctext :: Word8 -> Bool Source #
ctext - basic http grammar rule. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
quotedPair :: Parser Word8 Source #
quotedPair - basic http grammar rule. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
text :: Word8 -> Bool Source #
TEXT - basic http grammar rule. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
char :: Word8 -> Bool Source #
CHAR - basic http grammar rule. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
CTL - basic http grammar rule. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
token :: Parser ByteString Source #
token - basic http grammar rule.
The grammar specifies that adjacent LWS should be consumed without affecting the meaning of the token. This parser returns the token stripped of any adjacent lws.
separators :: Word8 -> Bool Source #
separators - basic http grammar rule. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
LWS - basic http grammar rule. (L)inear (W)hite(S)pace.
Consumes all linear whitespace. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
crlf - basic http grammar rule.
Consumes one crlf. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2