http-link-header-1.1.1: A parser and writer for the HTTP Link header per RFC 5988

Safe HaskellSafe
LanguageHaskell2010

Network.HTTP.Link.Parser

Contents

Description

The parser for the HTTP Link header as defined in RFC 5988. More liberal than the RFC though: does not validate URLs and other deep stuff, accepts whitespace in weird places.

Synopsis

Documentation

linkHeader :: Parser [Link] Source #

The Attoparsec parser for the Link header.

parseLinkHeader' :: Text -> Either String [Link] Source #

Parses a Link header, returns an Either, where Left is the Attoparsec error string (probably not a useful one).

parseLinkHeader :: Text -> Maybe [Link] Source #

Parses a Link header, returns a Maybe.

parseLinkHeaderBS' :: ByteString -> Either String [Link] Source #

Parses a Link header, returns an Either, where Left is the Attoparsec error string (probably not a useful one).

parseLinkHeaderBS :: ByteString -> Maybe [Link] Source #

Parses a Link header, returns a Maybe.

Generic links (GLink)

These functions are like the ones above, except they represent URLs as (IsURI uri) ⇒ uri values rather than concrete URIs from the network-uri package. Use these if you need access to the raw URLs (uri ~ Text) or some other representation of URLs.

Since: 1.1.0

parseGLinkHeader' :: IsURI uri => Text -> Either String [GLink uri] Source #

Parses a GLink header, returns an Either, where Left is the Attoparsec error string (probably not a useful one).

parseGLinkHeader :: IsURI uri => Text -> Maybe [GLink uri] Source #

Parses a GLink header, returns a Maybe.

parseGLinkHeaderBS' :: IsURI uri => ByteString -> Either String [GLink uri] Source #

Parses a GLink header, returns an Either, where Left is the Attoparsec error string (probably not a useful one).

parseGLinkHeaderBS :: IsURI uri => ByteString -> Maybe [GLink uri] Source #

Parses a GLink header, returns a Maybe.