Skip to content

Instantly share code, notes, and snippets.

@philopon
Created December 19, 2014 13:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philopon/4817f1ca86df7c841c16 to your computer and use it in GitHub Desktop.
Save philopon/4817f1ca86df7c841c16 to your computer and use it in GitHub Desktop.
xhr-json
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