homepage: http://github.com/fizruk/http-api-data
changelog-type: markdown
hash: d8dea014a0e5e2c3d2be0ff659c64a17910d18a4f3aa51da3059c9f7d10d4dfe
test-bench-deps:
  base: ==4.*
  time: -any
  hspec: ! '>=1.3'
  text: -any
  http-api-data: -any
  doctest: -any
  HUnit: -any
  QuickCheck: -any
  Glob: -any
maintainer: Nickolay Kudasov <nickolay.kudasov@gmail.com>
synopsis: Converting to/from HTTP API data like URL pieces, headers and query parameters.
changelog: ! '

'
basic-deps:
  bytestring: -any
  base: ! '>=4 && <5'
  time: -any
  text: ! '>=0.5'
all-versions:
- '0.1.0'
author: Michael Snoyman <michael@snoyman.com>
latest: '0.1.0'
description-type: markdown
description: ! '# http-api-data


  [![Build Status](https://secure.travis-ci.org/fizruk/http-api-data.png?branch=master)](http://travis-ci.org/fizruk/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

  >>> parseUrlPiece "something else" :: Either Text Bool

  Left "could not parse: `something else''"

  ```


  Numbers:


  ```

  >>> toUrlPiece 45.2

  "45.2"

  >>> parseUrlPiece "452" :: Either Text Int

  Right 452

  >>> parseUrlPiece "256" :: Either Text Int8

  Left "out of bounds: `256'' (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!


'
license-name: BSD3

Update from Hackage at 2015-10-07T14:18:51+0000
Update from Hackage at 2015-10-07T14:18:51+0000
