Comments (2)
+1, as a temporary alternative, I use ._body
directly.
from aiohttp.
And I found this. It works well.
import asyncio
from aiohttp import ClientResponse, ClientSession
class WrappedResponse(ClientResponse):
async def read(self) -> bytes:
if self._body is None:
await super().read()
return self._body
async def main():
async with ClientSession(response_class=WrappedResponse) as session:
async with session.get("https://httpbin.org/get") as resp:
await resp.read()
body = await resp.read()
print(len(body))
if __name__ == '__main__':
asyncio.run(main())
from aiohttp.
Related Issues (20)
- Broken timeout system with ws_connect HOT 1
- graceful shutdown order and cleanup contexts HOT 7
- ValueError: I/O operation on closed file in aiohttp payload size property on file uploading using form HOT 1
- Support for sending Trailer headers HOT 2
- Separate exception for DNS errors
- Weak Etag can not trigger negotiation caching
- The set request parameters were not used HOT 16
- Cannot make request behind a plain http proxy, aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host xxx ssl:default [None] HOT 1
- Exception with aiohttp Using HTTP Proxy in some cases HOT 1
- aiohttp cannot be used in python 3.14. HOT 4
- Iterate over response data (streaming) without decoding content HOT 1
- With forced TLSv1.3, still TLSv1.0 Client Hello is sent HOT 6
- 3.10.0 and 4.0.0 incorrectly reject wss:// urls HOT 3
- Http query character encoding issues HOT 1
- FastAPI integration HOT 2
- Doc Add ConnectionResetError exception to ClientWebSocketResponse documentation
- BaseConnector limit if of type `int` but documentation suggests `None` as an option
- ** 3.10 testing ** HOT 6
- WSS: `_pong_not_received` works (mostly) correctly but outcome is erased by `receive`'s `except EofStream:`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp.