Skip to content

Instantly share code, notes, and snippets.

@dcastro
Last active January 27, 2017 11:02
Show Gist options
  • Save dcastro/ffea08aa8b1b8bccd5f0ebccbb936546 to your computer and use it in GitHub Desktop.
Save dcastro/ffea08aa8b1b8bccd5f0ebccbb936546 to your computer and use it in GitHub Desktop.
Using purescript-affjax in psci
-- npm i xhr2 --save
import Prelude
import Control.Monad.Aff
import Control.Monad.Eff.Console
import Network.HTTP.Affjax
void $ runAff logShow (\x -> log x.response) (get "https://httpbin.org/ip" :: Affjax (console :: CONSOLE) String)
void $ runAff logShow (\x -> log (x.response :: String)) (get "https://httpbin.org/ip")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment