bburdette / httpjsontask / HttpJsonTask

Some basic json utils for use with elm/http.

jsonResolver : Json.Decode.Decoder a -> Http.Resolver Http.Error a

jsonResolver, similar to stringResolver or bytesResolver in elm/http.


type alias JsonArgs a =
{ url : String
, body : Http.Body
, decoder : Json.Decode.Decoder a 
}

Args struct for jsonTask and its relatives.

jsonTask : String -> JsonArgs a -> Task Http.Error a

make a json task; specify the http method as a string.

postJsonTask : JsonArgs a -> Task Http.Error a

jsonTask with method POST.

getJsonTask : JsonArgs a -> Task Http.Error a

jsonTask with method GET.

resolve : (body -> Result String a) -> Http.Response body -> Result Http.Error a

lifted out of elm/http