-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
question: using StreamingResponse
for json data
#419
Comments
Streaming responses expect a stream of bytes or text. If the JSON you're returning is a list of objects then I guess you could do something like this...
|
Hi! I can't see that this was resolved yet. What is the current workaround? Minimal working example:
AttributeError: 'dict' object has no attribute 'encode' I get the same error if the objects are Meh objects, e.g. |
You can use multiple inheritance with Sample code can be found at #2363 (comment) |
Hi,
I'm trying to use the Starlette
StreamingResponse
with a generator that yields adict
.However, when trying to get a return I get the following error
Some googling showed that the error is because the response expect a string input from the generator. Is there a way to fix this?
code snippet
Am I doing this wrong or am I expecting something that's not done?
Thanks a lot
M
The text was updated successfully, but these errors were encountered: