I know that might not be an issue with the library itself, but as Affjax is probably the most famous purescript library for ajax, it would make sense to be able to easily use Simple.JSON with it.
Currently I am getting the following error:
Could not match type
NonEmptyList ForeignError
with type
ResponseFormatError
It would be nice to have an easy way to have this transformation.
This is my code:
type MyRecordAlias =
{ userId :: Int
, id :: Int
, title :: String
, completed :: Boolean
}
main = void $ launchAff_ $ do
res <- AX.request (
AX.defaultRequest
{
url = "https://jsonplaceholder.typicode.com/todos/1",
method = Left GET,
responseFormat = ResponseFormat.string
}
)
case res.body >>= JSON.readJSON of
Right (r :: MyRecordAlias) -> do
log "all good"
Left e -> do
log "all bad"
I know that might not be an issue with the library itself, but as
Affjaxis probably the most famous purescript library for ajax, it would make sense to be able to easily useSimple.JSONwith it.Currently I am getting the following error:
It would be nice to have an easy way to have this transformation.
This is my code: