Skip to content

Commit 3a13c9c

Browse files
authored
[rest] fix aiohttp read in rest (#20952)
1 parent 8935901 commit 3a13c9c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

sdk/core/azure-core/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.19.0 (Unreleased)
3+
## 1.19.0 (2021-09-30)
44

55
### Features Added
66

sdk/core/azure-core/azure/core/rest/_aiohttp.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ def __getstate__(self):
171171
state['headers'] = CIMultiDict(self.headers) # MultiDictProxy is not pickable
172172
return state
173173

174+
async def read(self) -> bytes:
175+
"""Read the response's bytes into memory.
176+
177+
:return: The response's bytes
178+
:rtype: bytes
179+
"""
180+
if not self._content:
181+
self._stream_download_check()
182+
self._content = await self._internal_response.read()
183+
await self._set_read_checks()
184+
return _aiohttp_body_helper(self)
185+
174186
async def close(self) -> None:
175187
"""Close the response.
176188

0 commit comments

Comments
 (0)