purescript-cookbook
purescript-cookbook copied to clipboard
How to send AJAX requests via `affjax`
Description of Problem
Send and handle AJAX requests.
Proposed Name of Folder/Module
Unique Recipe Name: AjaxRequestsAffJax
Since there are a few HalogenHooks recipes that use Affjax, is this recipe still necessary?
I think it could be useful, like as a minimal example, I'm thinking this could be made as a Log-type recipe that runs either in Node or in the browser.
Oh right. I don't think we have an example in node and that requires adding xhr2, right?
Ah, yeah, I believe it would require adding xhr2.
Feel free to copy over any of the Affjax examples in the book. https://github.com/purescript-contrib/purescript-book/tree/master/exercises/chapter12/test For example endpoints, I found http://reqres.in/api more reliable than https://jsonplaceholder.typicode.com/