http-grammar-0.1.0.0: Attoparsec-based parsers for the RFC-2616 HTTP grammar rules.

Safe HaskellSafe
LanguageHaskell2010

Network.HTTP.Grammar

Contents

Description

This module provides Attoparsec-based parsers for the HTTP grammar rules as defined by RFC-2616.

Synopsis

Parsable data types.

data UserAgent Source #

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.

data Product Source #

A representation of an HTTP User-Agent product. https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.8

Productions

comment :: Parser ByteString Source #

comment - basic http grammar rule. The result is the parsed comment content, rather than the raw source.

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.

https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2

lws :: Parser () Source #

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 :: Parser () Source #

crlf - basic http grammar rule.

Consumes one crlf. https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2