aio-pika icon indicating copy to clipboard operation
aio-pika copied to clipboard

Why message body takes only bytes? Should 'json.dumps' + 'content_type=application/json' be enough?

Open jalvespinto opened this issue 1 year ago • 1 comments

Shouldn't self.body = body if isinstance(body, bytes) else bytes(body) use something like _as_bytes instead of bytes?

jalvespinto avatar May 01 '23 13:05 jalvespinto

You could take a look at class JsonRPC(RPC): in aio_pika/patterns/rpc.py Where you can pass json directly.

Aurvandill avatar May 17 '23 07:05 Aurvandill