(self, body)
| 63 | return self.__pop_receipt |
| 64 | |
| 65 | def __set_body(self, body): |
| 66 | if isinstance(body, str): |
| 67 | body = body.encode('utf-8') |
| 68 | |
| 69 | if not isinstance(body, (bytes, bytearray)): |
| 70 | raise TypeError( |
| 71 | f'response is expected to be either of ' |
| 72 | f'str, bytes, or bytearray, got {type(body).__name__}') |
| 73 | |
| 74 | self.__body = bytes(body) |
| 75 | |
| 76 | def get_body(self) -> bytes: |
| 77 | """Return message content as bytes.""" |