hreq-client 0.1.0.0 → 0.1.1.0
raw patch · 5 files changed
+22/−7 lines, 5 filesdep ~hreq-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hreq-core
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−1
- README.md +2/−2
- example/Main.hs +6/−2
- hreq-client.cabal +2/−2
- test/Hreq/HttpBin/SuccessSpec.hs +4/−0
CHANGELOG.md view
@@ -1,3 +1,10 @@-## Hreq-Client 0.1.0.0+## Hreq-Client 0.1.1.0++* Matching status codes with in response.++One can specify that a certain status code is expected in the http response+and when its not received we throw an error.++## Hreq-Client 0.1.1.0 * Initial public release
README.md view
@@ -1,7 +1,7 @@ # Hreq -[](https://hackage.haskell.org/package/hreq)+[](https://hackage.haskell.org/package/hreq-client) [](LICENSE)-[](https://travis-ci.org/epicallan/hreq)+[](https://travis-ci.org/epicallan/hreq) Implementation of Hreq Client. An HTTP client basing on hreq-core. Please look at the repository [README.md](https://github.com/epicallan/hreq/blob/master/README.md) file for more.
example/Main.hs view
@@ -28,8 +28,12 @@ getAllUsers :: RunClient m => m [User] getAllUsers = hreq @("all" :> GetJson [User]) Empty -createUser :: RunClient m => User -> m ()-createUser user = hreq @(JsonBody User :> EmptyResponse POST) (user :. Empty)+createUser :: RunClient m => User -> m User+createUser user = hreq @(JsonBody User :> PostJson User) (user :. Empty)++-- | status code should match 200 otherwise throw an error+statusEx :: RunClient m => m (Hlist '[ User ])+statusEx = hreq @(Verb GET '[ ResStatus 200, ResBody JSON User]) Empty -- | Don't run main without supplying a functioning baseUrl. main :: IO ()
hreq-client.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 2.0 name: hreq-client-version: 0.1.0.0+version: 0.1.1.0 synopsis: A Type dependent Highlevel HTTP client library. description: A Type dependent highlevel HTTP client library inspired by servant-client. category: Network, Web@@ -45,7 +45,7 @@ exceptions >= 0.10.0 && < 0.11, http-client >= 0.6.4 && < 0.7, http-client-tls >= 0.3.5 && < 0.4,- hreq-core >= 0.1.0,+ hreq-core >= 0.1.1, http-media >= 0.8.0 && < 0.9, http-types >= 0.12.3 && < 0.13, mtl >= 2.2.2 && < 3.0,
test/Hreq/HttpBin/SuccessSpec.hs view
@@ -17,6 +17,10 @@ r <- runHttpBin $ hreq @("get" :> RawResponse GET) Empty resStatusCode r `shouldBe` 200 + it "works with specifying status codes where by received code must match expected" $ do+ r <- runHttpBin $ hreq @(Verb GET '[ ResStatus 200 ]) Empty+ resStatusCode r `shouldBe` 200+ it "works with post requests" $ do r <- runHttpBin $ hreq @("post" :> JsonBody String :> PostJson Value) ("foo" :. Empty)