aio-pika
aio-pika copied to clipboard
Why message body takes only bytes? Should 'json.dumps' + 'content_type=application/json' be enough?
Shouldn't self.body = body if isinstance(body, bytes) else bytes(body)
use something like _as_bytes
instead of bytes
?
You could take a look at class JsonRPC(RPC):
in aio_pika/patterns/rpc.py
Where you can pass json directly.