Showing content from https://hackage.haskell.org/package/http-api-data below:
http-api-data: Converting to/from HTTP API data like URL pieces, headers and query parameters.
http-api-data: Converting to/from HTTP API data like URL pieces, headers and query parameters.
This package defines typeclasses used for converting Haskell data types to and from HTTP API data.
Please see README.md
[
Skip to Readme
]
Flags Manual Flags Name Description Default use-text-show
Use text-show library for efficient ToHttpApiData implementations.
Disabled
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Maintainer's Corner
Package maintainers
For package maintainers and hackage trustees
Candidates
Versions [RSS] 0.1.0, 0.1.1, 0.1.1.1, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.3.7.1, 0.3.7.2, 0.3.8, 0.3.8.1, 0.3.9, 0.3.10, 0.4, 0.4.1, 0.4.1.1, 0.4.2, 0.4.3, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2 (info) Change log CHANGELOG.md Dependencies base (>=4.12.0.0 && <4.22), bytestring (>=0.10.8.2 && <0.13), containers (>=0.6.0.1 && <0.8), cookie (>=0.5.1 && <0.6), hashable (>=1.4.4.0 && <1.6), http-types (>=0.12.4 && <0.13), tagged (>=0.8.8 && <0.9), text (>=1.2.3.0 && <1.3 || >=2.0 && <2.2), text-iso8601 (>=0.1.1 && <0.2), time-compat (>=1.9.5 && <1.10), transformers (>=0.5.6.2 && <0.7), unordered-containers (>=0.2.20 && <0.3), uuid-types (>=1.0.6 && <1.1) [details] Tested with ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.2, ghc ==9.2.8, ghc ==9.4.8, ghc ==9.6.7, ghc ==9.8.4, ghc ==9.10.1, ghc ==9.12.2 License BSD-3-Clause Author Nickolay Kudasov <nickolay.kudasov@gmail.com> Maintainer Nickolay Kudasov <nickolay.kudasov@gmail.com> Category Web Home page http://github.com/fizruk/http-api-data Source repo head: git clone https://github.com/fizruk/http-api-data Uploaded by phadej at 2025-03-31T23:31:38Z Distributions Arch:0.5.1, Debian:0.4.1.1, Fedora:0.5.1, LTSHaskell:0.6.2, NixOS:0.6.2, Stackage:0.6.2, openSUSE:0.6.2 Reverse Dependencies 151 direct, 997 indirect [details] Downloads 84606 total (114 in the last 30 days) Rating (no votes yet) [estimated by Bayesian average] Your Rating
Status Docs available [build log]
Last success reported on 2025-04-01 [all 1 reports] Readme for http-api-data-0.6.2
[
back to package description
]
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!
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4