Created
December 19, 2014 13:31
-
-
Save philopon/4817f1ca86df7c841c16 to your computer and use it in GitHub Desktop.
xhr-json
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
module Main where | |
import Data.Maybe | |
import Debug.Trace | |
import Data.JSON | |
import Network.XHR | |
main = get defaultAjaxOptions | |
{ onReadyStateChange = onSuccess $ \response -> do | |
txt <- getResponseText response | |
print (decode txt :: Maybe JValue) | |
} "/api.json" {queryParam: "bar"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment