network-api-support 0.2.3 → 0.3.0
raw patch · 5 files changed
+7/−43 lines, 5 filesdep ~aesondep ~http-clientdep ~http-client-tls
Dependency ranges changed: aeson, http-client, http-client-tls
Files
- http_client_post_0_5/Network/Api/Support/HandleCodes.hs +0/−8
- http_client_pre_0_5/Network/Api/Support/HandleCodes.hs +0/−8
- network-api-support.cabal +5/−23
- src/Network/Api/Support/Core.hs +1/−2
- src/Network/Api/Support/Response.hs +1/−2
− http_client_post_0_5/Network/Api/Support/HandleCodes.hs
@@ -1,8 +0,0 @@-module Network.Api.Support.HandleCodes (- handleAllResponseCodes-) where--import Network.HTTP.Client--handleAllResponseCodes :: Request -> Request-handleAllResponseCodes = id -- From http_version 0.5 the default is to do nothing
− http_client_pre_0_5/Network/Api/Support/HandleCodes.hs
@@ -1,8 +0,0 @@-module Network.Api.Support.HandleCodes (- handleAllResponseCodes-) where--import Network.HTTP.Client--handleAllResponseCodes :: Request -> Request-handleAllResponseCodes url = url { checkStatus = const . const . const $ Nothing }
network-api-support.cabal view
@@ -1,5 +1,5 @@ Name: network-api-support-Version: 0.2.3+Version: 0.3.0 License: BSD3 License-File: LICENSE Author: Mark Hibberd <mark@hibberd.id.au>@@ -11,15 +11,13 @@ Bug-reports: https://github.com/markhibberd/network-api-support/issues Cabal-Version: >= 1.8 Build-Type: Simple+Tested-With: GHC == 7.10.3, GHC == 8.0.2 Description: Toolkit for building http client libraries over Network.Http.Conduit. . /Note/: Examples of use can be found in the pin and postmark client libraries. -extra-source-files:- http_client_post_0_5/Network/Api/Support/HandleCodes.hs- http_client_pre_0_5/Network/Api/Support/HandleCodes.hs Source-Repository head Type: git@@ -28,42 +26,26 @@ Flag small_base Description: Choose the new, split-up base package. -Flag http_client_pre_0_5- Description: Use version < 0.5 of http-client- Default: False- Library Build-Depends: base >= 3 && < 6- , aeson >= 0.5 && < 1.2+ , aeson >= 0.5 && < 0.13 , attoparsec >= 0.10 && < 0.14 , bytestring >= 0.9.1.5 && < 0.11 , case-insensitive >= 0.2 && < 1.3 , http-types >= 0.6 && < 0.10- , http-client-tls >= 0.2.1.1 && < 0.4+ , http-client >= 0.2.2.2 && < 0.5+ , http-client-tls >= 0.2.1.1 && < 0.3 , text >= 0.11 && < 1.3 , time == 1.* , tls >= 1.2.0 && < 1.4 - if flag(http_client_pre_0_5)- Build-Depends:- http-client >= 0.2.2.2 && < 0.5- else- Build-Depends:- http-client >= 0.5 && < 0.6 GHC-Options: -Wall -fno-warn-orphans Hs-Source-Dirs: src- if flag(http_client_pre_0_5)- Hs-Source-Dirs:- http_client_pre_0_5- else- Hs-Source-Dirs:- http_client_post_0_5- Exposed-Modules: Network.Api.Support
src/Network/Api/Support/Core.hs view
@@ -6,7 +6,6 @@ import Network.Api.Support.Request import Network.Api.Support.Response-import Network.Api.Support.HandleCodes import Control.Monad @@ -40,7 +39,7 @@ -> IO b runRequest' settings url transform responder = do url' <- parseRequest $ unpack url- let url'' = handleAllResponseCodes url'+ let url'' = url' { checkStatus = const . const . const $ Nothing } -- handle all response codes. let req = appEndo transform url'' manager <- newManager settings liftM (responder req) $ httpLbs req manager
src/Network/Api/Support/Response.hs view
@@ -6,7 +6,6 @@ , basicResponder ) where -import Control.Applicative import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import Data.Attoparsec.Lazy@@ -29,7 +28,7 @@ fmap _ (DecodeError t) = DecodeError t fmap f (JsonSuccess a) = JsonSuccess $ f a -instance Applicative JsonResult where +instance Applicative JsonResult where pure = JsonSuccess (JsonSuccess f) <*> m = fmap f m