-
-
Save jkarni/587813295cf0fd363b7c to your computer and use it in GitHub Desktop.
debug servant-client requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module Realm.Newrelic where | |
import Control.Monad.Trans.Either | |
import Data.Proxy | |
import Data.Text (Text) | |
import Servant.API | |
import Servant.Client | |
import Servant.Common.Req | |
type DeploymentParams = [(Text, Text)] | |
type Deployments = "deployments.xml" | |
:> ReqBody '[FormUrlEncoded] DeploymentParams | |
:> Post '[PlainText] Text | |
:> Debug | |
data Debug | |
deriving instance Show Req | |
instance HasClient (Post a b :> Debug) where | |
type Client (Post a b :> Debug) = Req | |
clientWithRoute Proxy req baseurl = req | |
api :: Proxy Deployments | |
api = Proxy | |
postDeployment :: Req | |
postDeployment = client api (BaseUrl Https "api.newrelic.com" 443) [("app_name", "meh")] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment