Copyright | (C) 2016-2025 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Miso.Fetch
Description
Module for interacting with the Fetch API https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API manually.
Refer to the miso README if you want to automatically interact with a Servant API.
Synopsis
- fetchJSON :: FromJSON action => MisoString -> MisoString -> Maybe MisoString -> [(MisoString, MisoString)] -> (action -> JSM ()) -> (MisoString -> JSM ()) -> JSM ()
Documentation
Arguments
:: FromJSON action | |
=> MisoString | url |
-> MisoString | method |
-> Maybe MisoString | body |
-> [(MisoString, MisoString)] | headers |
-> (action -> JSM ()) | successful callback |
-> (MisoString -> JSM ()) | errorful callback |
-> JSM () |
Retrieve JSON via Fetch API
Basic GET of JSON using Fetch API, will be expanded upon.
See https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API