ZeroIntensity / view.py

The Batteries-Detachable Web Framework
https://view.zintensity.dev
MIT License
205 stars 15 forks source link

Support for receiving and sending bytes #174

Open ZeroIntensity opened 4 months ago

ZeroIntensity commented 4 months ago

Description:

As of now, view.py only supports sending and receiving str objects, not bytes. This shouldn’t be too hard to implement for sending, but will probably require some changes to the route input implementation to support receiving bytes objects.

This could look like:

from view import new_app

app = new_app()

@app.get("/")
async def index():
    return b"Hello, world!"

app.run()

This will make file responses and uploads possible.