http-types

Generic HTTP types for Haskell (for both client and server code).

https://github.com/Vlix/http-types

LTS Haskell 24.43:0.12.4@rev:1
Stackage Nightly 2026-06-01:0.12.5
Latest on Hackage:0.12.5

See all snapshots http-types appears in

BSD-3-Clause licensed by Aristid Breitkreuz, Michael Snoyman
Maintained by [email protected]
This version can be pinned in stack with:http-types-0.12.5@sha256:cb708ff8d2001dc7bcff615350a835a6dc1b2488829acfcc6d8bc7e13d423153,2927

Build Status Hackage Stackage LTS Stackage Nightly BSD 3-Clause License

Generic HTTP types for Haskell (for both client and server code).

The goal of this library is to have one location for any library, package or project to base their general HTTP types on for better interoperability.

This library provides basic types for the following:

  • HTTP versions (e.g. HTTP/1.1)
  • HTTP methods (e.g. GET)
  • HTTP headers (e.g. Content-Type)
  • HTTP statusses (e.g. 404)

This library also contains some utility functions, e.g. related to URI handling, that are not necessarily restricted in use to HTTP, but the scope is restricted to things that are useful inside HTTP, i.e. no FTP URI parsing.

Changes

Changelog for http-types

0.12.5 [2026-05-31]

  • Add status 451 Unavailable For Legal Reasons
  • Add http30 as a shortcut for HttpVersion 3 0
  • Export everything from Network.HTTP.Types
  • Added a bunch of regression, unit and property tests for stability.
  • Updated the README.md
  • Lowest GHC version supported is now 7.10.3. Adjusted dependency constraints to reflect this.
  • Removed explicit Typeable class derivations since that happens automatically since GHC 7.10

0.12.4 [2023-11-29]

  • Add Data and Generic instances to ByteRange, StdMethod, Status and HttpVersion.
  • Rework of all the documentation, with the addition of @since notations.

0.12.3 [2019-02-24]

  • Remove now-invalid doctest options from doctests.hs.

0.12.2 [2018-09-26]

  • Add new parseQueryReplacePlus function, which allows specifying whether to replace '+' with ' '.
  • Add header name constants for “Prefer” and “Preference-Applied” (RFC 7240).

0.12.1 [2018-01-31]

  • Add new functions for constructing a query URI where not all parts are escaped.

0.12 [2018-01-28]

  • URI encoding is now back to upper-case hexadecimal, as that is the preferred canonicalization, and the previous change caused issues with URI signing in at least amazonka.

0.11 [2017-11-29]

  • Remove dependency on blaze-builder. (Note that as a side effect of this, URI encoding is now using lower-case rather than upper-case hexadecimal.)
  • Add Bounded instance to Status.
  • Re-export more status codes and http20 from Network.HTTP.Types.

0.10 [2017-10-22]

  • New status codes, new headers.
  • Fixed typo in imATeapot, added missing toEnum.
  • Oh, and http20.

0.9.1 [2016-06-04]

  • New function: parseByteRanges.
  • Support for HTTP status 422 “Unprocessable Entity” (RFC 4918).

0.9 [2015-10-09]

  • No changelog was maintained up to version 0.9.