elm-pages icon indicating copy to clipboard operation
elm-pages copied to clipboard

Feature request: Server.Request.bytesBody

Open supermario opened this issue 7 months ago • 0 comments

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!

supermario avatar Jul 19 '24 05:07 supermario