http-media
Processing HTTP Content-Type and Accept headers
This library is intended to be a comprehensive solution to parsing and
selecting quality-indexed values in HTTP headers. It is capable of
parsing both media types and language parameters from the Accept and
Content header families, and can be extended to match against other
accept headers as well. Selecting the appropriate header value is
achieved by comparing a list of server options against the
quality-indexed values supplied by the client.
In the following example, the Accept header is parsed and then matched
against a list of server options to serve the appropriate media using
'mapAcceptMedia':
> getHeader >>= maybe send406Error sendResourceWith . mapAcceptMedia
> [ ("text/html", asHtml)
> , ("application/json", asJson)
> ]
Similarly, the Content-Type header can be used to produce a parser for
request bodies based on the given content type with 'mapContentMedia':
> getContentType >>= maybe send415Error readRequestBodyWith . mapContentMedia
> [ ("application/json", parseJson)
> , ("text/plain", parseText)
> ]
The API is agnostic to your choice of server.
| version | uploaded | uploader | changes | |
|---|---|---|---|---|
| 0.8.1.1 | 2023-09-10 07:00 UTC | TimothyJones | 3 revisions | +1149/−1349 lines, 27 filesdep ~QuickCheckdep ~bytestringdep ~containersPVP: major bump suggested |
| 0.8.1.0 | 2023-09-02 03:21 UTC | TimothyJones | 1 revisions | +138/−114 lines, 13 filesdep +tastydep +tasty-quickcheckdep −test-frameworkdep −test-framework-quickcheck2dep ~QuickCheckPVP ok |
| 0.8.0.0 | 2019-04-15 23:01 UTC | TimothyJones | 8 revisions | +816/−277 lines, 24 filesdep ~QuickCheckdep ~basedep ~bytestringPVP ok |
| 0.7.1.3 | 2018-10-06 20:38 UTC | TimothyJones | 1 revisions | +10/−6 lines, 2 filesdep ~QuickCheckdep ~basedep ~containersPVP ok |
| 0.7.1.2 | 2018-02-06 02:53 UTC | TimothyJones | 2 revisions | +7/−2 lines, 2 filesdep ~QuickCheckdep ~basePVP: major bump suggested |
| 0.7.1.1 | 2017-08-03 02:30 UTC | TimothyJones | +9/−5 lines, 2 filesdep ~basePVP ok | |
| 0.7.1 | 2017-07-15 05:52 UTC | TimothyJones | +63/−6 lines, 2 filesdep ~basedep ~utf8-stringPVP ok | |
| 0.7.0 | 2017-06-25 22:16 UTC | TimothyJones | 1 revisions | +107/−120 lines, 11 filesdep +utf8-stringdep ~QuickCheckdep ~basePVP ok |
| 0.6.4 | 2016-07-13 05:07 UTC | TimothyJones | +6/−5 lines, 2 filesdep ~QuickCheckPVP ok | |
| 0.6.3 | 2016-02-02 07:17 UTC | TimothyJones | +193/−135 lines, 13 filesPVP: major bump suggested | |
| 0.6.2 | 2015-05-05 06:14 UTC | TimothyJones | +71/−62 lines, 8 filesdep +test-frameworkdep +test-framework-quickcheck2dep −Cabaldep −cabal-test-quickcheckPVP ok | |
| 0.6.1 | 2015-03-30 06:30 UTC | TimothyJones | +36/−3 lines, 9 filesdep ~basePVP ok | |
| 0.6.0 | 2015-02-24 01:43 UTC | TimothyJones | 1 revisions | +4/−4 lines, 4 filesPVP ok |
| 0.5.1 | 2015-02-20 02:43 UTC | TimothyJones | 1 revisions | +2/−2 lines, 1 filesdep ~CabalPVP ok |
| 0.5.0 | 2015-02-16 00:04 UTC | TimothyJones | 1 revisions | +303/−217 lines, 19 filesdep +case-insensitivedep −utf8-stringdep ~Cabaldep ~basedep ~bytestringsetup-changedPVP ok |
| 0.4.0 | 2014-10-15 05:34 UTC | TimothyJones | +119/−97 lines, 12 files | |
| 0.3.0 | 2014-10-02 03:31 UTC | TimothyJones | +449/−42 lines, 14 files | |
| 0.2.0 | 2014-07-31 14:23 UTC | TimothyJones | +440/−212 lines, 15 filesdep ~Cabaldep ~QuickCheck | |
| 0.1.1 | 2013-10-14 04:40 UTC | TimothyJones | +18/−11 lines, 6 files | |
| 0.1.0 | 2013-10-14 04:10 UTC | TimothyJones | +1185/−0 lines, 15 filesdep +Cabaldep +QuickCheckdep +basesetup-changed |
Dependencies of http-media-0.8.1.1
QuickCheck >=2.8 && <2.19 2.18.0.0 → 2.19.0.0 newer than bounds
| 2026-09-16 11:18 UTC | 2.19.0.0 newer than bounds | +67/−41 lines, 10 filesdep +OneTuplePVP ok |
| 2026-02-26 12:42 UTC | 2.18.0.0 | +826/−542 lines, 23 filesPVP ok |
| 2025-10-13 12:40 UTC | 2.17.1.0 | +18/−8 lines, 4 filesdep ~randomPVP: major bump suggested |
| 2025-10-07 12:26 UTC | 2.17.0.0 | +667/−129 lines, 14 filesdep +data-array-bytedep +hintdep +splitdep −ghc-primdep −old-localedep −old-timedep ~basedep ~randomdep ~template-haskellPVP ok |
| 2025-06-17 07:53 UTC | 2.16.0.0 | +477/−86 lines, 15 filesdep ~basenew-uploaderPVP ok |
showing 5 of 66 versions
base >=4.8 && <5 4.22.0.0 → 4.22.1.0
| 2026-12-01 12:38 UTC | 4.22.1.0 | +388/−6 lines, 9 filesdep ~ghc-internalPVP: major bump suggested |
| 2025-12-19 11:52 UTC | 4.22.0.0 | +886/−215 lines, 28 filesdep ~ghc-internalPVP ok |
| 2026-03-27 12:26 UTC | 4.21.2.0 | +10/−3 lines, 4 filesdep ~ghc-internalPVP ok |
| 2025-12-27 10:31 UTC | 4.21.1.0 | +17/−5 lines, 4 filesdep ~ghc-internalPVP ok |
| 2024-12-16 09:24 UTC | 4.21.0.0 | +1170/−396 lines, 39 filesdep ~ghc-internalPVP ok |
showing 5 of 61 versions
bytestring >=0.10 && <0.13 0.12.1.0 → 0.12.2.0
| 2024-12-06 21:41 UTC | 0.12.2.0 | +538/−437 lines, 44 filesdep ~QuickCheckdep ~basePVP ok |
| 2024-02-16 03:27 UTC | 0.12.1.0 | +3398/−1642 lines, 37 filesdep +sybdep ~basePVP: major bump suggested |
| 2023-08-16 01:53 UTC | 0.12.0.2 | +16/−2 lines, 3 files |
| 2023-08-05 00:03 UTC | 0.12.0.1 | +47/−9 lines, 3 files |
| 2023-07-07 01:45 UTC | 0.12.0.0 | +1459/−520 lines, 21 filesdep +data-array-bytePVP ok |
showing 5 of 49 versions
case-insensitive >=1.0 && <1.3 1.2.1.0 → 1.2.2.0
| 2026-11-05 20:14 UTC | 1.2.2.0 | +114/−94 lines, 8 filesdep +tastydep +tasty-hunitdep +template-haskelldep −semigroupsdep −test-frameworkdep −test-framework-hunitdep ~basedep ~bytestringdep ~deepseqnew-uploaderPVP ok |
| 2019-05-05 04:35 UTC | 1.2.1.0 | +12/−1 lines, 4 filesnew-uploaderPVP: major bump suggested |
| 2018-03-14 20:12 UTC | 1.2.0.11 | +21/−17 lines, 2 filesdep ~HUnitdep ~basedep ~bytestringPVP: major bump suggested |
| 2017-05-27 14:27 UTC | 1.2.0.10 | +7/−2 lines, 2 filesdep ~HUnitdep ~basedep ~criterionPVP ok |
| 2017-04-22 13:43 UTC | 1.2.0.9 | +9/−4 lines, 2 filesdep ~basePVP ok |
showing 5 of 32 versions
containers >=0.5 && <0.9 0.8 → 0.8.1
| 2026-10-04 06:08 UTC | 0.8.1 | +8085/−5169 lines, 39 filesdep +template-haskell-liftdep ~arraydep ~deepseqPVP: major bump suggested |
| 2025-03-01 13:03 UTC | 0.8 | +8447/−7031 lines, 37 filesnew-uploaderPVP ok |
| 2023-09-27 12:15 UTC | 0.7 | +76/−33 lines, 3 filesPVP ok |
| 2023-09-28 04:21 UTC | 0.6.8 | +644/−184 lines, 17 filesdep ~basedep ~deepseqPVP: major bump suggested |
| 2023-02-01 03:11 UTC | 0.6.7 | +783/−229 lines, 20 filesPVP: major bump suggested |
showing 5 of 43 versions
tasty >=0.11 && <1.6 1.5.4 → 1.5.5
| 2026-10-20 23:13 UTC | 1.5.5 | +53/−26 lines, 7 filesdep +terminal-sizePVP ok |
| 2026-03-25 20:04 UTC | 1.5.4 | +332/−166 lines, 22 filesdep −semigroupsPVP ok |
| 2025-01-05 19:52 UTC | 1.5.3 | +36/−11 lines, 3 filesdep ~containersdep ~optparse-applicativePVP: major bump suggested |
| 2024-11-03 00:34 UTC | 1.5.2 | +22/−5 lines, 4 filesdep ~basePVP ok |
| 2024-06-22 10:14 UTC | 1.5.1 | +131/−63 lines, 10 filesdep ~basePVP: major bump suggested |
showing 5 of 76 versions
tasty-quickcheck >=0.8 && <0.12 0.11 → 0.11.1
| 2025-01-05 19:53 UTC | 0.11.1 | +66/−33 lines, 4 filesdep +regex-tdfadep −pcre-lightdep ~QuickCheckdep ~basedep ~optparse-applicativePVP: major bump suggested |
| 2024-06-22 10:14 UTC | 0.11 | +132/−49 lines, 4 filesdep ~QuickCheckPVP ok |
| 2023-09-10 00:10 UTC | 0.10.3 | +52/−14 lines, 3 filesdep ~QuickCheckdep ~optparse-applicativedep ~randomnew-uploaderPVP ok |
| 2021-11-20 19:17 UTC | 0.10.2 | +21/−13 lines, 3 filesdep ~basePVP: major bump suggested |
| 2020-12-18 09:42 UTC | 0.10.1.2 | +27/−13 lines, 4 filesdep ~basePVP: major bump suggested |
showing 5 of 23 versions
utf8-string >=0.3 && <1.1 1.0.1.1 → 1.0.2
| 2021-01-03 18:33 UTC | 1.0.2 | +286/−46 lines, 8 filesdep +HUnitdep +utf8-stringdep ~basePVP: major bump suggested |
| 2015-08-23 16:19 UTC | 1.0.1.1 | +12/−2 lines, 3 filesdep ~basePVP ok |
| 2015-08-21 22:38 UTC | 1.0.1 | +71/−3 lines, 3 filesdep ~basePVP: major bump suggested |
| 2015-01-23 01:51 UTC | 1 | +17/−194 lines, 5 filesdep ~basePVP ok |
| 2014-05-19 08:05 UTC | 0.3.8 | +50/−7 lines, 9 filesdep ~basePVP ok |
showing 5 of 16 versions
Reverse dependencies
174 packages depend on http-media; 30 have bounds that exclude 0.8.1.1
showing 100 of 174, bound-excluded first