The http-link-header package

[Tags:benchmark, library, public-domain, test]

https:github.commyfreewebhttp-link-header


[Skip to Readme]

Properties

Versions 0.1.0, 0.2.0, 1.0.0, 1.0.1, 1.0.2, 1.0.3
Dependencies attoparsec, base (>=4.3.0.0 && <5), bytestring, bytestring-conversion, errors, http-api-data, network-uri, text [details]
License PublicDomain
Copyright 2014-2016 Greg V <greg@unrelenting.technology>
Author Greg V
Maintainer greg@unrelenting.technology
Category Web
Home page https://github.com/myfreeweb/http-link-header
Source repository head: git clone git://github.com/myfreeweb/http-link-header.git
Uploaded Mon Nov 14 11:27:36 UTC 2016 by myfreeweb
Distributions LTSHaskell:1.0.3, NixOS:1.0.3, Stackage:1.0.3, Tumbleweed:1.0.3
Downloads 594 total (11 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-11-16 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for http-link-header

Readme for http-link-header-1.0.3

http-link-header Hackage Build Status Coverage Status unlicense

A Haskell library than implements a parser and a writer for the HTTP Link header as specified in RFC 5988 "Web Linking".

Usage

import Network.HTTP.Link
import Network.URI
import Data.Maybe

----- Writing
writeLinkHeader [ Link (fromJust $ parseURI "https://example.com/hello%20world") [(Rel, "next"), (Title, "hello world")]
                , Link (fromJust $ parseURI "https://yolo.tld") [(Rel, "license")] ]
-- "<https://example.com/hello%20world>; rel=\"next\"; title=\"hello world\", <https://yolo.tld>; rel=\"license\""

----- Parsing
parseLinkHeader "<https://example.com/2>; rel=\"next\", <https://example.com/0>; rel=prev"
-- Just [ Link https://example.com/2 [(Rel, "next")]
--      , Link https://example.com/0 [(Rel, "prev")] ]

Development

Use stack to build.
Use ghci to run tests quickly with :test (see the .ghci file).

$ stack build

$ stack test && rm tests.tix

$ stack bench

$ stack ghci --ghc-options="-fno-hpc"

Contributing

Please feel free to submit pull requests! Bugfixes and simple non-breaking improvements will be accepted without any questions :-)

By participating in this project you agree to follow the Contributor Code of Conduct.

The list of contributors is available on GitHub.

License

This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.