dillonkearns / elm-pages

Hybrid Elm framework with full-stack and static routes.
https://elm-pages.com
BSD 3-Clause "New" or "Revised" License
658 stars 97 forks source link

Feature request: Server.Request.bytesBody #484

Open supermario opened 4 months ago

supermario commented 4 months ago

When making a Http.bytesBody "application/octet-stream" someBytes call to elm-pages it would be nice to be able to get a Bytes body on the other side. We would then have;

Server.Request.body : Request -> Maybe String
Server.Request.bytesBody : Request -> Maybe Bytes
Server.Request.jsonBody : Maybe (Result Error value)

So maybe it makes more sense to just be explicit:

Server.Request.stringBody : Request -> Maybe String
Server.Request.bytesBody : Request -> Maybe Bytes
Server.Request.jsonBody : Maybe (Result Error value)

This would also align to the https://package.elm-lang.org/packages/elm/http/latest/Http#stringBody naming, which is nice I guess!