servant/servant-client-core/src/Servant/Client/Core.hs

66 lines
1.7 KiB
Haskell
Raw Normal View History

2017-09-13 18:36:20 +02:00
-- | This module provides backend-agnostic functionality for generating clients
-- from @servant@ APIs. By "backend," we mean something that concretely
-- executes the request, such as:
--
2017-09-14 19:21:53 +02:00
-- * The @http-client@ library
-- * The @haxl@ library
2017-09-13 18:36:20 +02:00
-- * GHCJS via FFI
--
-- etc.
--
-- Each backend is encapsulated in a monad that is an instance of the
-- 'RunClient' class.
--
2017-09-14 19:21:53 +02:00
-- This library is primarily of interest to backend-writers and
-- combinator-writers. For more information, see the README.md
2017-09-07 19:05:12 +02:00
module Servant.Client.Core
2017-09-13 17:05:48 +02:00
(
-- * Client generation
clientIn
, HasClient(..)
2017-09-13 17:05:48 +02:00
2017-09-13 18:36:20 +02:00
-- * Request
2017-09-14 19:17:19 +02:00
, Request
, RequestF(..)
2017-09-13 18:36:20 +02:00
, defaultRequest
, RequestBody(..)
2017-09-13 17:05:48 +02:00
-- * Authentication
2017-09-13 18:36:20 +02:00
, mkAuthenticatedRequest
, basicAuthReq
, AuthenticatedRequest(..)
2017-09-13 17:05:48 +02:00
, AuthClientData
-- * Generic Client
, ClientLike(..)
, genericMkClientL
, genericMkClientP
, ServantError(..)
2017-05-16 18:00:15 +02:00
, EmptyClient(..)
2017-09-13 17:05:48 +02:00
-- * Response
, Response
, GenResponse (..)
2017-09-13 17:05:48 +02:00
, RunClient(..)
2017-09-07 22:38:31 +02:00
, module Servant.Client.Core.Internal.BaseUrl
2017-10-25 02:12:21 +02:00
, StreamingResponse(..)
2017-09-13 17:05:48 +02:00
-- * Writing HasClient instances
2017-09-13 18:36:20 +02:00
-- | These functions need not be re-exported by backend libraries.
2017-09-12 18:38:52 +02:00
, addHeader
, appendToQueryString
, appendToPath
, setRequestBodyLBS
, setRequestBody
) where
2017-09-13 18:36:20 +02:00
import Servant.Client.Core.Internal.Auth
2018-06-30 21:17:08 +02:00
import Servant.Client.Core.Internal.BaseUrl
(BaseUrl (..), InvalidBaseUrlException, Scheme (..),
parseBaseUrl, showBaseUrl)
2017-09-13 18:36:20 +02:00
import Servant.Client.Core.Internal.BasicAuth
import Servant.Client.Core.Internal.Generic
2018-06-30 21:17:08 +02:00
import Servant.Client.Core.Internal.HasClient
2017-09-13 18:36:20 +02:00
import Servant.Client.Core.Internal.Request
import Servant.Client.Core.Internal.RunClient