Popularity
9.0
Stable
Activity
1.3
Declining
49
3
38
Monthly Downloads: 473
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Latest version: v0.4.2
http-api-data alternatives and similar packages
Based on the "http" category.
Alternatively, view http-api-data alternatives based on common mentions on social networks and blogs.
-
http-reverse-proxy
Reverse proxy HTTP requests, either over raw sockets or with WAI -
http-proxy
A Haskell library for writing HTTP and HTTPS proxies. -
wai-cors
A Haskell implementation of Cross-Origin resource sharing (CORS) for Wai -
http-conduit-downloader
HTTP downloader tailored for web-crawler needs -
http-grammar
Attoparsec-based parsers for the RFC-2616 HTTP grammar rules. -
http-common
Base Haskell types used by a variety of HTTP clients and servers.
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
Do you think we are missing an alternative of http-api-data or a related project?
README
http-api-data
This package defines typeclasses used for converting Haskell data types to and from HTTP API data.
Examples
Booleans:
>>> toUrlPiece True
"true"
>>> parseUrlPiece "false" :: Either Text Bool
Right False
>>> parseUrlPieces ["true", "false", "undefined"] :: Either Text [Bool]
Left "could not parse: `undefined'"
Numbers:
>>> toQueryParam 45.2
"45.2"
>>> parseQueryParam "452" :: Either Text Int
Right 452
>>> toQueryParams [1..5]
["1","2","3","4","5"]
>>> parseQueryParams ["127", "255"] :: Either Text [Int8]
Left "out of bounds: `255' (should be between -128 and 127)"
Strings:
>>> toHeader "hello"
"hello"
>>> parseHeader "world" :: Either Text String
Right "world"
Calendar day:
>>> toQueryParam (fromGregorian 2015 10 03)
"2015-10-03"
>>> toGregorian <$> parseQueryParam "2016-12-01"
Right (2016,12,1)
Contributing
Contributions and bug reports are welcome!