Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

elm-jsonp

Send HTTP requests to servers that implement strict CORS headers.

It emulates elm-http's Http.send and Http.get API. POST requests have not been implemented yet.

Usage

Because we aren't allowed to publish packages with Native JS code, you'll either have to clone this project into a vendor/elm-jsonp folder and add it to your elm-package.json source-directories and alter the Native module name.

Or, you can use elm_self_publish which will take care of changing the Native module to your project's user and name, compiling the package, and copying it to your project's elm-stuff/packages. I'd recommend using this script.

Example

importHttpimportJsonpimportJson.DecodeasJsonexposing ((:=))
importTaskexposing (Task)
type alias Info={ identified :Bool}lookupInfo:TaskHttp.ErrorInfolookupInfo =Jsonp.get infoDecoder ("https://api.twitch.tv/kraken")infoDecoder:Json.DecoderInfoinfodecoder =Json.object1 Info("identified":=Json.bool)

About

Task API for doing JSONP requests in Elm

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages