Commit 763cdefc authored by Mael NICOLAS's avatar Mael NICOLAS

[WIP] Basic /search/fl using Text as Type

parent 38ec795a
module Main where
import Lib
import Network.HTTP.Client (newManager)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Servant.Client
import HAL.Client
main :: IO ()
main = someFunc
main = do
manager' <- newManager tlsManagerSettings
res <- runClientM
(fl Nothing)
(mkClientEnv manager' $ BaseUrl Https "api.archives-ouvertes.fr" 443 "search")
case res of
(Left err) -> print err
(Right val) -> print val
......@@ -21,6 +21,12 @@ description: Please see the README on GitHub at <https://github.com/gith
dependencies:
- base >= 4.7 && < 5
- servant
- servant-client
- aeson
- http-client-tls
- http-client
- text
library:
source-dirs: src
......
module Client where
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
module HAL.Client where
import Data.Proxy
import GHC.Generics
import Servant.API
import Servant.Client
import Data.Text
type HALAPI = "" :> QueryParam "fl" Text :> Get '[JSON] [Text]
halAPI :: Proxy HALAPI
halAPI = Proxy
fl :: Maybe Text -> ClientM [Text]
fl = client halAPI
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment