Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for receiving and sending bytes #174

Open
ZeroIntensity opened this issue May 15, 2024 · 0 comments
Open

Support for receiving and sending bytes #174

ZeroIntensity opened this issue May 15, 2024 · 0 comments
Labels
advanced This should only be looked at by someone who knows what they're doing api This has to do with the Python API (view) c api This has to do with the C API (_view) improvement Improvement to an existing feature
Milestone

Comments

@ZeroIntensity
Copy link
Owner

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.

@ZeroIntensity ZeroIntensity added improvement Improvement to an existing feature advanced This should only be looked at by someone who knows what they're doing c api This has to do with the C API (_view) api This has to do with the Python API (view) labels May 15, 2024
@ZeroIntensity ZeroIntensity added this to the Beta Release milestone May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced This should only be looked at by someone who knows what they're doing api This has to do with the Python API (view) c api This has to do with the C API (_view) improvement Improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant