File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,18 @@ npm install xhr2
2525You can construct requests with the ` affjax ` function:
2626
2727``` purescript
28+ module Main where
29+
30+ import Prelude
31+ import Control.Monad.Eff.Console (log)
32+ import Control.Monad.Eff.Class (liftEff)
33+ import Control.Monad.Aff (launchAff)
34+ import Data.Either (Either(..))
35+ import Data.HTTP.Method (Method(..))
36+ import Network.HTTP.Affjax (affjax, defaultRequest)
37+
2838main = launchAff $ do
29- res <- affjax $ defaultRequest { url = "/api", method = GET }
39+ res <- affjax $ defaultRequest { url = "/api", method = Left GET }
3040 liftEff $ log $ "GET /api response: " ++ res.response
3141```
3242
@@ -35,6 +45,8 @@ main = launchAff $ do
3545Or use of a number of helpers for common cases:
3646
3747``` purescript
48+ import Network.HTTP.Affjax (get, post)
49+
3850main = launchAff $ do
3951 res1 <- get "/api"
4052 liftEff $ log $ "GET /api response: " ++ res1.response
You can’t perform that action at this time.
0 commit comments