kkazuo / expect-bytes / Http.Just

Expect Bytes with Http

Expect

expectBytes : (Result Http.Error Bytes -> msg) -> Http.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
        }