Get response body as a buffer (memoryview or bytes). Returns a memoryview in MicroPython or bytes in Pyodide, representing the raw binary data.
(self)
| 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 | """ |
nothing calls this directly
no test coverage detected