bburdette/httpjsontask/1.0.0

HttpJsonTask

Some basic json utils for use with elm/http.

jsonResolver : Decoder a -> Resolver Error a

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

type alias JsonArgs a =
{ url : String
, body : Body
, decoder : Decoder a
}

Args struct for jsonTask and its relatives.

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

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

postJsonTask : JsonArgs a -> Task Error a

jsonTask with method POST.

getJsonTask : JsonArgs a -> Task Error a

jsonTask with method GET.

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

lifted out of elm/http