@@ -23,6 +23,7 @@ import Network.Wai
23import Servant.API
23import Servant.API
24import Servant.Docs
24import Servant.Docs
25import Servant.Server
25import Servant.Server
26+import Web.FormUrlEncoded(FromForm(..), ToForm(..))
28And we'll import some things from one of our earlier modules
29And we'll import some things from one of our earlier modules
@@ -218,6 +219,9 @@ type ExampleAPI2 = "position" :> Capture "x" Int :> Capture "y" Int :> Get '[JSO
218 :<|> "hello" :> QueryParam "name" String :> Get '[JSON] HelloMessage
219 :<|> "hello" :> QueryParam "name" String :> Get '[JSON] HelloMessage
219 :<|> "marketing" :> ReqBody '[JSON, FormUrlEncoded] ClientInfo :> Post '[JSON] Email
220 :<|> "marketing" :> ReqBody '[JSON, FormUrlEncoded] ClientInfo :> Post '[JSON] Email
222+instance ToForm ClientInfo
223+instance FromForm ClientInfo
221exampleAPI2 :: Proxy ExampleAPI2
225exampleAPI2 :: Proxy ExampleAPI2
222exampleAPI2 = Proxy
226exampleAPI2 = Proxy