Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/kkazuo/expect-bytes
- Owner: kkazuo
- License: mit
- Created: 2021-10-14T00:11:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-14T00:19:13.000Z (about 3 years ago)
- Last Synced: 2023-08-08T20:39:29.917Z (over 1 year ago)
- Language: Elm
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.Justtype Msg
= GotBytes (Result Http.Error Bytes)getBytes : Cmd Msg
getBytes =
Http.get
{ url = "/bytes"
, expect = Http.Just.expectBytes GotBytes
}```