kkazuo/expect-bytes/1.0.0

Http.Just

Expect Bytes with Http

Expect

expectBytes : (Result Error Bytes -> msg) -> Expect msg

Expect the response body to be binary data.

import Bytes exposing (Bytes)
import Http
import Http.Just


type Msg
    = GotBytes (Result Http.Error Bytes)


getBytes : Cmd Msg
getBytes =
    Http.get
        { url = "/bytes"
        , expect = Http.Just.expectBytes GotBytes
        }