Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kkazuo/expect-bytes

Expect Bytes with Http
https://github.com/kkazuo/expect-bytes

Last synced: about 14 hours ago
JSON representation

Expect Bytes with Http

Awesome Lists containing this project

README

        

# Expect Bytes with Http

This package provides the function `expectBytes` that you will expect for Http.

You will not wasting time searching how to do just receive Bytes from `Http.get` any more.

[1]: https://stackoverflow.com/questions/60383450/elm-byte-decoding-within-http-get

# Example

```elm

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
}

```