MCPcopy Index your code
hub / github.com/pyscript/pyscript / arrayBuffer

Method arrayBuffer

core/src/stdlib/pyscript/fetch.py:45–57  ·  view source on GitHub ↗

Get response body as a buffer (memoryview or bytes). Returns a memoryview in MicroPython or bytes in Pyodide, representing the raw binary data.

(self)

Source from the content-addressed store, hash-verified

43 return getattr(self._response, attr)
44
45 async def arrayBuffer(self):
46 """
47 Get response body as a buffer (memoryview or bytes).
48
49 Returns a memoryview in MicroPython or bytes in Pyodide, representing
50 the raw binary data.
51 """
52 buffer = await self._response.arrayBuffer()
53 if hasattr(buffer, "to_py"):
54 # Pyodide conversion.
55 return buffer.to_py()
56 # MicroPython conversion.
57 return memoryview(as_bytearray(buffer))
58
59 async def blob(self):
60 """

Callers

nothing calls this directly

Calls 2

as_bytearrayFunction · 0.90
arrayBufferMethod · 0.45

Tested by

no test coverage detected