lukewestby/http-extra/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Http.Extra

Convenience functions for working with Http

Expects

expectJsonResponse : Decoder a -> Expect (Response a)

Decode a response body as JSON, but keep the rest of the response. Unlike Http.expecJson, you can decode using a Decoder but still get access to response headers, status code, etc.

expectValue : a -> Expect a

Complete a request with a predetermined value. Using Json.Decode.succeed fails when the the server doesn't send back valid JSON, as expectJson always attempts to parse the response body as JSON. expectValue skips decoding entirely.

expectNothing : Expect ()

Complete a request with a () value. Skips JSON decoding to always complete with (), regardless of what the server returns.