http-link-header: A parser and writer for the HTTP Link header as specified in RFC 5988 "Web Linking".

[ library, public-domain, web ] [ Propose Tags ]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.2.0, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.3.1, 1.1.1, 1.2.0, 1.2.1
Dependencies attoparsec, base (>=4.0.0.0 && <5), errors, network-uri, text [details]
License Apache-2.0
Copyright 2014 Val Packett <val@packett.cool>
Author Val Packett
Maintainer val@packett.cool
Revised Revision 2 made by valpackett at 2022-10-17T23:37:03Z
Category Web
Home page https://codeberg.org/valpackett/http-link-header
Source repo head: git clone https://codeberg.org/valpackett/http-link-header.git
Uploaded by myfreeweb at 2014-11-03T16:37:34Z
Distributions Debian:1.0.3.1, LTSHaskell:1.2.1, NixOS:1.2.1, Stackage:1.2.1
Reverse Dependencies 8 direct, 10 indirect [details]
Downloads 9766 total (76 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for http-link-header-0.1.0

[back to package description]

http-link-header Hackage Build Status Coverage Status Apache License 2.0

A Haskell library than implements a parser and a writer for the HTTP Link header as specified in RFC 5988 "Web Linking". Very fast. Not 100% compliant (does anyone actually use title*?). Liberal parser, conservative writer.

Usage

import Network.HTTP.Link

----- Writing
writeLinkHeader [ Link "https://example.com/hello world" [(Rel, "next"), (Title, "hello world")]
                , Link "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

# Update to latest version of Cabal.
cabal update
cabal install cabal-install

# Initialize a sandbox and install the package's dependencies.
make install

# Configure & build the package.
make configure build

# Test package.
make test

# Benchmark package.
make test

# Start a REPL.
make repl

# Generate documentation.
make haddock

License

Copyright 2014 Greg V floatboth@me.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.