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

websocket.receive() binary data #57

Closed
jbq opened this issue Mar 23, 2019 · 3 comments
Closed

websocket.receive() binary data #57

jbq opened this issue Mar 23, 2019 · 3 comments

Comments

@jbq
Copy link

jbq commented Mar 23, 2019

Hi, I'm successfully using Quart's websocket, and I'm now wondering why websocket.receive() returns str is there a way to get bytes instead? I'm working with a binary protocol, so it would be nice to have raw data access and it sounds weird to encode the input.

@pgjones
Copy link
Member

pgjones commented Mar 23, 2019

It should return either str or bytes (AnyStr) depending on what the client sends. There may be a bug if it is decoding the bytes.

@jbq
Copy link
Author

jbq commented Mar 23, 2019

It may be my bad, part of my code was still sending str. The Quart Websocket documentation does has no example with binary and doesn't mention it, hence my question.

@jbq jbq closed this as completed Mar 23, 2019
@pgjones
Copy link
Member

pgjones commented Mar 23, 2019

No worries, I've added some more documentation here 72bd6e9.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants