Safe Haskell | None |
---|---|
Language | Haskell2010 |
Servant.Client.Core.Internal.BaseUrl
Synopsis
- data Scheme
- data BaseUrl = BaseUrl {}
- showBaseUrl :: BaseUrl -> String
- newtype InvalidBaseUrlException = InvalidBaseUrlException String
- parseBaseUrl :: MonadThrow m => String -> m BaseUrl
Documentation
URI scheme to use
Instances
Eq Scheme Source # | |
Data Scheme Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Scheme -> c Scheme Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Scheme Source # toConstr :: Scheme -> Constr Source # dataTypeOf :: Scheme -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Scheme) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Scheme) Source # gmapT :: (forall b. Data b => b -> b) -> Scheme -> Scheme Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Scheme -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Scheme -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Scheme -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Scheme -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Scheme -> m Scheme Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Scheme -> m Scheme Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Scheme -> m Scheme Source # | |
Ord Scheme Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl | |
Show Scheme Source # | |
Generic Scheme Source # | |
Lift Scheme Source # | |
type Rep Scheme Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl |
Simple data type to represent the target of HTTP requests for servant's automatically-generated clients.
Constructors
BaseUrl | |
Fields
|
Instances
Eq BaseUrl Source # | |
Data BaseUrl Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BaseUrl -> c BaseUrl Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BaseUrl Source # toConstr :: BaseUrl -> Constr Source # dataTypeOf :: BaseUrl -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BaseUrl) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BaseUrl) Source # gmapT :: (forall b. Data b => b -> b) -> BaseUrl -> BaseUrl Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BaseUrl -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BaseUrl -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BaseUrl -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BaseUrl -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BaseUrl -> m BaseUrl Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BaseUrl -> m BaseUrl Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BaseUrl -> m BaseUrl Source # | |
Ord BaseUrl Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl | |
Show BaseUrl Source # | |
Generic BaseUrl Source # | |
Lift BaseUrl Source # | |
ToJSON BaseUrl Source # |
|
ToJSONKey BaseUrl Source # |
|
Defined in Servant.Client.Core.Internal.BaseUrl Methods | |
FromJSON BaseUrl Source # |
|
FromJSONKey BaseUrl Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl Methods | |
type Rep BaseUrl Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl type Rep BaseUrl = D1 (MetaData "BaseUrl" "Servant.Client.Core.Internal.BaseUrl" "servant-client-core-0.15-5FMeCxbuOU3JWsNm17U8jh" False) (C1 (MetaCons "BaseUrl" PrefixI True) ((S1 (MetaSel (Just "baseUrlScheme") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Scheme) :*: S1 (MetaSel (Just "baseUrlHost") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :*: (S1 (MetaSel (Just "baseUrlPort") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "baseUrlPath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))) |
showBaseUrl :: BaseUrl -> String Source #
>>>
showBaseUrl <$> parseBaseUrl "api.example.com"
"http://api.example.com"
newtype InvalidBaseUrlException Source #
Constructors
InvalidBaseUrlException String |
Instances
Show InvalidBaseUrlException Source # | |
Defined in Servant.Client.Core.Internal.BaseUrl | |
Exception InvalidBaseUrlException Source # | |
parseBaseUrl :: MonadThrow m => String -> m BaseUrl Source #
>>>
parseBaseUrl "api.example.com"
BaseUrl {baseUrlScheme = Http, baseUrlHost = "api.example.com", baseUrlPort = 80, baseUrlPath = ""}
Note: trailing slash is removed
>>>
parseBaseUrl "api.example.com/"
BaseUrl {baseUrlScheme = Http, baseUrlHost = "api.example.com", baseUrlPort = 80, baseUrlPath = ""}
>>>
parseBaseUrl "api.example.com/dir/"
BaseUrl {baseUrlScheme = Http, baseUrlHost = "api.example.com", baseUrlPort = 80, baseUrlPath = "/dir"}
>>>
import Data.Aeson
>>>
import Data.Foldable (traverse_)
>>>
import qualified Data.ByteString.Lazy.Char8 as LBS8
>>>
import qualified Data.Map.Strict as Map