Skip to content

Commit 49ea4ab

Browse files
committed
Update README.md
Import all the stuff!
1 parent b8694b3 commit 49ea4ab

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@ npm install xhr2
2525
You 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+
2838
main = 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
3545
Or use of a number of helpers for common cases:
3646

3747
```purescript
48+
import Network.HTTP.Affjax (get, post)
49+
3850
main = launchAff $ do
3951
res1 <- get "/api"
4052
liftEff $ log $ "GET /api response: " ++ res1.response

0 commit comments

Comments
 (0)