ex_http_link
From the creator or HTTPotion and a Haskell version of this...
An Elixir library than implements a parser and a writer for the HTTP Link header as specified in RFC 5988 "Web Linking".
Why this when ex_link_header exists? This one uses awesome NimbleParsec parser combinators instead of messy regexps and doesn't turn arbitrary strings into atoms.
Installation
Add ex_http_link to your project's dependencies in mix.exs:
def deps do
[
{:ex_http_link, "~> 0.1.0"}
]
end
And fetch your project's dependencies:
$ mix deps.get
Usage
iex> ExHttpLink.parse ~S(<http://example.com>; rel="example"; rev=test, <yolo.swag>; whatEver="")
{:ok, [ { "http://example.com", {"rel", "example"}, {"rev", "test"} },
{ "yolo.swag", {"whatEver", ""} } ]}
Contributing
Please feel free to submit pull requests!
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.