This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Basic foundation for HTTP communication
version 3.0.1
license BSD3
native-modules True
elm-version 0.17.0 <= v < 0.18.0
Tag 3.0.1
Committed At 2016-03-27 21:42:04 UTC
elm-lang/core 4.0.0 <= v < 5.0.0 4.0.5

Modules

README

elm-http

Make HTTP requests in Elm.

The Http module aims to cover some of the most common cases of requesting JSON data, but also have lower-level functions such that the API covers all of the underlying functionality.

Example

import Http
import Json.Decode as Json exposing ((:=))
import Task exposing (..)


lookupZipCode : String -> Task Http.Error (List String)
lookupZipCode query =
    Http.get places ("http://api.zippopotam.us/us/" ++ query)


places : Json.Decoder (List String)
places =
  let place =
        Json.object2 (\city state -> city ++ ", " ++ state)
          ("place name" := Json.string)
          ("state" := Json.string)
  in
      "places" := Json.list place