0

So I'm trying to serialize an object

raise ObjectNotFound(
                f"target object not found: source_object={source_object.json()}"
            )

The object has a key that is streamed (Body.read()). So i get this error

"Object of type 'StreamingBody' is not JSON serializable"

How do I serialize my object while excluding the key Body

edmamerto
  • 6,439
  • 10
  • 35
  • 52
  • 1
    Maybe delete the key `del source_object['Body']`. Or pop it to use it later `pop(source_object['Body'])` – The Fool Sep 26 '21 at 17:56

0 Answers0