Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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
- linkHeader :: Parser [Link]
- parseLinkHeader' :: Text -> Either String [Link]
- parseLinkHeader :: Text -> Maybe [Link]
- parseLinkHeaderBS' :: ByteString -> Either String [Link]
- parseLinkHeaderBS :: ByteString -> Maybe [Link]
- parseGLinkHeader' :: IsURI uri => Text -> Either String [GLink uri]
- parseGLinkHeader :: IsURI uri => Text -> Maybe [GLink uri]
- parseGLinkHeaderBS' :: IsURI uri => ByteString -> Either String [GLink uri]
- parseGLinkHeaderBS :: IsURI uri => ByteString -> Maybe [GLink uri]
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).
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
(
values rather than concrete IsURI
uri) ⇒ uriURI
s 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.