{wd5      !"#$%&'()*+,-./01234Safe +0kSimple data type to represent the target of HTTP requests for servant's automatically-generated clients.URI scheme to usehost (eg "haskell.org") port (eg 80) path (eg "ab/c")URI scheme to usehttp:// https://5 67   5 67None+N  ! param name param value"#$%&'()*  !"#$%&'()$*  !"#$%&'()   !"#$%&'()*None3>L+hFor better type inference and to avoid usage of a data family, we newtype wrap the combination of some .8 and a function to add authentication data to a request4NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE.For a resource protected by authentication (e.g. AuthProtect), we need to provide the client with some data used to add authentication data to a request4NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE/>Handy helper to avoid wrapping datatypes in tuples everywhere.4NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE+,-./+,-./+,-./+,-./None3>L01Authenticate a request using Basic Authentication0000None'()345>KLN 1This class lets us define how each API combinator influences the creation of an HTTP request. It's mostly an internal class, you can just use 4.44@ allows you to produce operations to query an API from a client. ltype MyApi = "books" :> Get '[JSON] [Book] -- GET /books :<|> "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book -- POST /books myApi :: Proxy MyApi myApi = Proxy getAllBooks :: ExceptT String IO [Book] postNewBook :: Book -> ExceptT String IO Book (getAllBooks :<|> postNewBook) = client myApi host manager where host = BaseUrl Http "localhost" 80808"Make the querying function append path to the request path.9 If you use a : in one of your endpoints in your API, the corresponding querying function will automatically take an additional argument of the type specified by your :g. That function will take care of encoding this argument as JSON and of using it as the request body.(All you need is for your type to have a ToJSON instance.Example: type MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book myApi :: Proxy MyApi myApi = Proxy addBook :: Book -> ExceptT String IO Book addBook = client myApi host manager where host = BaseUrl Http "localhost" 8080 -- then you can just use "addBook" to query that endpoint;Pick a MethodK and specify where the server you want to query is. You get back the full <.= If you use a >s in one of your endpoints in your API, the corresponding querying function will automatically take an additional ? argument. If you give @,, nothing will be added to the query string.lOtherwise, this function will insert a value-less query string parameter under the name associated to your >.Example: ztype MyApi = "books" :> QueryFlag "published" :> Get '[JSON] [Book] myApi :: Proxy MyApi myApi = Proxy getBooks :: Bool -> ExceptT String IO [Book] getBooks = client myApi host where host = BaseUrl Http "localhost" 8080 -- then you can just use "getBooks" to query that endpoint. -- 'getBooksBy False' for all books -- 'getBooksBy True' to only get _already published_ booksA If you use a B in one of your endpoints in your API, the corresponding querying function will automatically take an additional argument, a list of values of the type specified by your B.EIf you give an empty list, nothing will be added to the query string.Otherwise, this function will take care of inserting a textual representation of your values in the query string, under the same query string parameter name.OYou can control how values for your type are turned into text by specifying a C instance for your type.Example: type MyApi = "books" :> QueryParams "authors" Text :> Get '[JSON] [Book] myApi :: Proxy MyApi myApi = Proxy getBooksBy :: [Text] -> ExceptT String IO [Book] getBooksBy = client myApi host where host = BaseUrl Http "localhost" 8080 -- then you can just use "getBooksBy" to query that endpoint. -- 'getBooksBy []' for all books -- 'getBooksBy ["Isaac Asimov", "Robert A. Heinlein"]' -- to get all books by Asimov and HeinleinD If you use a E in one of your endpoints in your API, the corresponding querying function will automatically take an additional argument of the type specified by your E, enclosed in Maybe.?If you give Nothing, nothing will be added to the query string.If you give a non-Fn value, this function will take care of inserting a textual representation of this value in the query string.OYou can control how values for your type are turned into text by specifying a C instance for your type.Example: type MyApi = "books" :> QueryParam "author" Text :> Get '[JSON] [Book] myApi :: Proxy MyApi myApi = Proxy getBooksBy :: Maybe Text -> ExceptT String IO [Book] getBooksBy = client myApi host where host = BaseUrl Http "localhost" 8080 -- then you can just use "getBooksBy" to query that endpoint. -- 'getBooksBy Nothing' for all books -- 'getBooksBy (Just "Isaac Asimov")' to get all books by Isaac AsimovGUsing a H= combinator in your API doesn't affect the client functions.I If you use a J in one of your endpoints in your API, the corresponding querying function will automatically take an additional argument of the type specified by your J, wrapped in Maybe.WThat function will take care of encoding this argument as Text in the request headers.(All you need is for your type to have a C instance.Example: newtype Referer = Referer { referrer :: Text } deriving (Eq, Show, Generic, FromText, ToHttpApiData) -- GET /view-my-referer type MyApi = "view-my-referer" :> Header "Referer" Referer :> Get '[JSON] Referer myApi :: Proxy MyApi myApi = Proxy viewReferer :: Maybe Referer -> ExceptT String IO Book viewReferer = client myApi host where host = BaseUrl Http "localhost" 8080 -- then you can just use "viewRefer" to query that endpoint -- specifying Nothing or e.g Just "http://haskell.org/" as argumentsK If you use a L in one of your endpoints in your API, the corresponding querying function will automatically take an additional argument of the type specified by your L|. That function will take care of inserting a textual representation of this value at the right place in the request path.OYou can control how values for this type are turned into text by specifying a C instance for your type.Example: type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book myApi :: Proxy MyApi myApi = Proxy getBook :: Text -> ExceptT String IO Book getBook = client myApi host manager where host = BaseUrl Http "localhost" 8080 -- then you can just use "getBook" to query that endpointMA client querying function for a N b5 will actually hand you one function for querying a and another one for querying b", stitching them together with N#, which really is just like a pair. dtype MyApi = "books" :> Get '[JSON] [Book] -- GET /books :<|> "books" :> ReqBody '[JSON] Book :> Post Book -- POST /books myApi :: Proxy MyApi myApi = Proxy getAllBooks :: ExceptT String IO [Book] postNewBook :: Book -> ExceptT String IO Book (getAllBooks :<|> postNewBook) = client myApi host manager where host = BaseUrl Http "localhost" 80801234OPQRST89;=ADGIUVWXKM! +,-./1234.+,-4123/1234OPQRST89;=ADGIUVWXKMY      !"#$%&'()*+,-.//0123456789:;<=>?@ABC<DEFGHFGIJ<DKLMNO<DPQRSTUVWX<YZ[<\]^<_`abcdefghijkserva_Aluk16RWkMIDmA1eSdzoxAServant.Common.BaseUrlServant.Common.Req Servant.Client.Experimental.AuthServant.Common.BasicAuthServant.ClientInvalidBaseUrlExceptionBaseUrl baseUrlScheme baseUrlHost baseUrlPort baseUrlPathSchemeHttpHttps showBaseUrl parseBaseUrlReqreqPathqsreqBody reqAcceptheaders ServantErrorFailureResponseresponseStatusresponseContentType responseBody DecodeFailure decodeErrorUnsupportedContentTypeInvalidContentTypeHeaderresponseContentTypeHeaderConnectionErrorconnectionErrordefReq appendToPathappendToQueryString addHeader setRQBody reqToRequestdisplayHttpRequestperformRequestperformRequestCTperformRequestNoBodycatchConnectionError$fExceptionServantErrorAuthenticateReq unAuthReqAuthClientDatamkAuthenticateReq basicAuthReq HasClientClientclientWithRouteclient"$fExceptionInvalidBaseUrlException $fEqBaseUrl$fHasClient*:>4$fHasClient*:>5serva_0o0b0Dp1pA8GqWnnANRlG9Servant.API.ReqBodyReqBody$fHasClient*Rawhttpc_HNPB2Nx43L1Bx5LAZyh70BNetwork.HTTP.Client.TypesResponse$fHasClient*:>6Servant.API.QueryParam QueryFlagghc-prim GHC.TypesBoolFalse$fHasClient*:>7 QueryParamshttpa_3kiLcpdXTUe4CYRpIoinpPWeb.HttpApiData.Internal ToHttpApiData$fHasClient*:>8 QueryParambaseGHC.BaseNothing$fHasClient*:>9httpt_2kqnYpPBpbH1f4ygoPM6quNetwork.HTTP.Types.Version HttpVersion$fHasClient*:>10Servant.API.HeaderHeader$fHasClient*:>11Servant.API.CaptureCapture$fHasClient*:<|>Servant.API.Alternative:<|>$fHasClient*:>$fHasClient*:>0$fHasClient*WithNamedContext$fHasClient*:>1$fHasClient*:>2$fHasClient*:>3$fHasClient*Verb$fHasClient*Verb0$fHasClient*Verb1$fHasClient*Verb2