MCPcopy Create free account
hub / github.com/Azure/azure-functions-python-library / __set_body

Method __set_body

azure/functions/_queue.py:65–74  ·  view source on GitHub ↗
(self, body)

Source from the content-addressed store, hash-verified

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."""

Callers 1

__init__Method · 0.95

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected