NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #49 most downloaded on PyPI
Async http client/server framework (asyncio)
Last release 2 months ago
23 Jul 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
7 versions withdrawn
withdrawn after publishing
13 years old
312 releases · first in 2013
Make request.app point to proper application instance when using nested applications (with middlewares).
Bugfix release
request.app point to proper application instance when using nested
applications (with middlewares). (#2550)connector.connect().
(#2567)Having a ; in Response content type doesn't assume it contains a charset anymore.
Bugfix release.
; in Response content type doesn't assume it contains a charset
anymore. (#2197)getattr(asyncio, 'async') for keeping compatibility with Python 3.7.
(#2476)NotImplementedError raised by set_child_watcher from uvloop.
(#2491)ClientSession.__del__ by stopping to try to close it.
(#2523)One column per quarter.
Fix passing client max size on cloning request obj.
Bugfix release
_http_parser shared object from tarball distribution. (#2414)aiohttp.web.run_app function. (#2431)_SessionRequestContextManager closes the session properly now. (#2441)from_env to trust_env in client reference. (#2451)Nothing published for this version
Nothing published for this version
Relax attribute lookup in warning about old-styled middleware
Nothing published for this version
Deprecate registering synchronous web handlers
On behalf of aiohttp development team I'm pleased to announce next aiohttp release.
It contains very long list of new features and bug fixes (see it below).
Most important changes are:
ClientSession supports trust_env parameter for getting proxy configuration from environment variables (disabled by default).Request.remote property for accessing to IP of connected client.brotli encodingThe full list of changes:
ClientSession.request (#1128)multidict 3.0. All HTTP headers preserve casing now but compared
in case-insensitive way. (#1994)normalize_path_middleware. Added possibility to handle URLs
with query string. (#1995)trust_env=True param in ClientSession. (#1998)router.add_routes and router decorators. (#2004)BaseRequest.has_body in favor of
BaseRequest.can_read_body Added BaseRequest.body_exists
attribute that stays static for the lifetime of the request (#2005)BaseRequest.loop attribute (#2024)_CoroGuard awaitable and fix ClientSession.close warning message
(#2026)get_client, get_server, setUpAsync and tearDownAsync methods to
AioHTTPTestCase (#2032)RequestBase.remote property for accessing to IP of client
initiated HTTP request. (#2123)append_version arg into StaticResource.url and
StaticResource.url_for methods for getting an url with hash (version) of
the file. (#2157)RuntimeError if HTTPS protocol is required but ssl module is not present.
(#2221)shutdown_asyncgens before event loop closing on Python 3.6. (#2227)InvalidURL instead of ValueError on fetches with invalid URL.
(#2241)DummyCookieJar into cookiejar.py (#2242)run_app: Make print=None disable printing (#2260)brotli encoding (generic-purpose lossless compression algorithm)
(#2270)compress=15 the client will support deflate
compress negotiation. (#2273)verify_ssl, fingerprint, ssl_context and proxy_headers by
client.ws_connect. (#2292)aiohttp.ClientConnectorSSLError when connection fails due
ssl.SSLError (#2294)aiohttp.web.Application.make_handler support access_log_class (#2315)ClientSession as an
asynchronous context manager. (#2063)CookieJar incorrectly expiring cookies in some edge cases.
(#2084)IndexError being raised by the StreamReader.iter_chunks()
generator. (#2112)FileResponse sending empty chunked body on 304. (#2143)Content-Length: 0 to GET/HEAD/TRACE/OPTIONS requests by default.
(#2167)KeyError: <aiohttp.connector._TransportPlaceholder> (#2193)TypeError in helpers.guess_filename if name is not a
string (#2201)StreamReader. (#2251)web.FileResponse overriding user supplied Content-Type (#2317)await resp.text() if
charset was not provided by Content-Type HTTP header. Pass explicit
encoding to solve it. (#1811)disqus widget from documentation pages. (#2018)connector_owner parameter. (#2072)encoded=True for yarl.URL, it disables all yarl transformations.
(#2198)Server.finish_connections (#2006)Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Don't raise deprecation warning on loop.run_until_complete(client.close()) (#2065 _)
Don't raise deprecation warning on loop.run_until_complete(client.close()) (#2065)
Fix issue with synchronous session closing when using ClientSession as an asynchronous context manager. (#2063 _)
Fix issue with synchronous session closing when using ClientSession as an asynchronous context manager. (#2063)
- Fix _CoroGuard for python 3.4 ----
Fix _CoroGuard for python 3.4
Allow await session.close() along with yield from session.close()
Allow await session.close() along with yield from session.close()
Relax yarl requirement to 0.11+
Relax yarl requirement to 0.11+
Backport #2026: session.close is a coroutine (#2029)
Fix wrong startup sequence: test server and run_app() are not raise DeprecationWarning now #1947
Add doc for add_head, update doc for add_get. #1944
Fixed consecutive calls for Response.write_eof.
Retain method attributes (e.g. :code:__doc__) when registering synchronous
handlers for resources. #1953
Added signal TERM handling in run_app to gracefully exit #1932
Fix websocket issues caused by frame fragmentation. #1962
Raise RuntimeError is you try to set the Content Length and enable chunked encoding at the same time #1941
Small update for unittest_run_loop
Use CIMultiDict for ClientRequest.skip_auto_headers #1970
Fix wrong startup sequence: test server and run_app() are not raise
DeprecationWarning now #1947
Make sure cleanup signal is sent if startup signal has been sent #1959
Fixed server keep-alive handler, could cause 100% cpu utilization #1955
Connection can be destroyed before response get processed if
await aiohttp.request(..) is used #1981
MultipartReader does not work with -OO #1969
Fixed ClientPayloadError with blank Content-Encoding header #1931
Support deflate encoding implemented in httpbin.org/deflate #1918
Fix BadStatusLine caused by extra CRLF after POST data #1792
Keep a reference to ClientSession in response object #1985
Deprecate undocumented app.on_loop_available signal #1978
Added support for experimental async-tokio event loop written in Rust https://github.com/PyO3/tokio
Added support for experimental async-tokio event loop written in Rust
https://github.com/PyO3/tokio
Write to transport \r\n before closing after keepalive timeout,
otherwise client can not detect socket disconnection. #1883
Only call loop.close in run_app if the user did not supply a loop.
Useful for allowing clients to specify their own cleanup before closing the
asyncio loop if they wish to tightly control loop behavior
Content disposition with semicolon in filename #917
Added request_info to response object and ClientResponseError. #1733
Added history to ClientResponseError. #1741
Allow to disable redirect url re-quoting #1474
Handle RuntimeError from transport #1790
Dropped "%O" in access logger #1673
Added args and kwargs to unittest_run_loop. Useful with other
decorators, for example @patch. #1803
Added iter_chunks to response.content object. #1805
Avoid creating TimerContext when there is no timeout to allow compatibility with Tornado. #1817 #1180
Add proxy_from_env to ClientRequest to read from environment
variables. #1791
Add DummyCookieJar helper. #1830
Fix assertion errors in Python 3.4 from noop helper. #1847
Do not unquote + in match_info values #1816
Use Forwarded, X-Forwarded-Scheme and X-Forwarded-Host for better scheme and host resolution. #1134
Fix sub-application middlewares resolution order #1853
Fix applications comparison #1866
Fix static location in index when prefix is used #1662
Make test server more reliable #1896
Use Forwarded, X-Forwarded-Scheme and X-Forwarded-Host for better scheme and host resolution. #1134
Extend list of web exceptions, add HTTPUnprocessableEntity, HTTPFailedDependency, HTTPInsufficientStorage status codes #1920
Fix exception description #1807
Fix pypi distribution
Fix exception description #1807
Handle socket error in FileResponse #1773
Cancel websocket heartbeat on close #1793
Fix web.run_app not to bind to default host-port pair if only socket is passed #1786
Fix web.run_app not to bind to default host-port pair if only socket is
passed #1786
Keeping blank values for request.post() and multipart.form() #1765
TypeError in ResponseHandler.data_received #1770
Keeping blank values for request.post() and multipart.form() (#1765)
TypeError in data_received of ResponseHandler (#1770)
Fix web.run_app not to bind to default host-port pair if only socket is passed (#1786)
Memory leak with aiohttp.request #1756
Memory leak with aiohttp.request #1756
Disable cleanup closed ssl transports by default.
Exception in request handling if the server responds before the body is sent #1761
Memory leak with aiohttp.request #1756
Memory leak with aiohttp.request #1756
Encoding is always UTF-8 in POST data #1750
Do not add "Content-Disposition" header by default #1755
Call https website through proxy will cause error (#1745 _)
Fixed Application.on_loop_available signal #1739
Fixed Application.on_loop_available signal #1739
Remove debug code
Fix allow-head to include name on route #1737
Fix allow-head to include name on route #1737
Fixed AttributeError in WebSocketResponse.can_prepare #1736
With this amount of api changes we had to make backward incompatible changes. Please check this migration document http://aiohttp.readthedocs.io/en/la…
For this release we completely refactored low-level implementation of http handling.
Finally uvloop gives performance improvement. Overall performance improvement
should be around 70-90% compared to 1.x version.
We took opportunity to refactor long standing api design problems across whole package. Client exceptions handling has been cleaned up and now much more straight forward. Client payload management simplified and allows to extend with any custom type. Client connection pool implementation has been redesigned as well, now there is no need for actively releasing response objects, aiohttp handles connection release automatically.
Another major change, we moved aiohttp development to public organization https://github.com/aio-libs
With this amount of api changes we had to make backward incompatible changes. Please check this migration document http://aiohttp.readthedocs.io/en/latest/migration.html
Please report problems or annoyance with with api to https://github.com/aio-libs/aiohttp
Added json to ClientSession.request() method #1726
Added session's raise_for_status parameter, automatically calls raise_for_status() on any request. #1724
response.json() raises ClientReponseError exception if response's
content type does not match #1723
Cleanup timer and loop handle on any client exception.
Deprecate loop parameter for Application's constructor
2.0.0rc1 (2017-03-15)Properly handle payload errors #1710
Added ClientWebSocketResponse.get_extra_info() #1717
It is not possible to combine Transfer-Encoding and chunked parameter, same for compress and Content-Encoding #1655
Connector's limit parameter indicates total concurrent connections.
New limit_per_host added, indicates total connections per endpoint. #1601
Use url's raw_host for name resolution #1685
Change ClientResponse.url to yarl.URL instance #1654
Add max_size parameter to web.Request reading methods #1133
Web Request.post() stores data in temp files #1469
Add the allow_head=True keyword argument for add_get #1618
run_app and the Command Line Interface now support serving over
Unix domain sockets for faster inter-process communication.
run_app now supports passing a preexisting socket object. This can be useful
e.g. for socket-based activated applications, when binding of a socket is
done by the parent process.
Implementation for Trailer headers parser is broken #1619
Fix FileResponse to not fall on bad request (range out of file size)
Fix FileResponse to correct stream video to Chromes
Deprecate public low-level api #1657
Deprecate encoding parameter for ClientSession.request() method
Dropped aiohttp.wsgi #1108
Dropped version from ClientSession.request() method
Dropped websocket version 76 support #1160
Dropped: aiohttp.protocol.HttpPrefixParser #1590
Dropped: Servers response's .started, .start() and .can_start() method #1591
Dropped: Adding sub app via app.router.add_subapp() is deprecated
use app.add_subapp() instead #1592
Dropped: Application.finish() and Application.register_on_finish() #1602
Dropped: web.Request.GET and web.Request.POST
Dropped: aiohttp.get(), aiohttp.options(), aiohttp.head(), aiohttp.post(), aiohttp.put(), aiohttp.patch(), aiohttp.delete(), and aiohttp.ws_connect() #1593
Dropped: aiohttp.web.WebSocketResponse.receive_msg() #1605
Dropped: ServerHttpProtocol.keep_alive_timeout attribute and
keep-alive, keep_alive_on, timeout, log constructor parameters #1606
Dropped: TCPConnector's`` .resolve, .resolved_hosts, .clear_resolved_hosts()attributes andresolve` constructor parameter #1607
Dropped ProxyConnector #1609
Warning! This is not final release. It contains backward incompatible change, please check compatibility before installing on production systems.
Warning! This is not final release. It contains backward incompatible change, please check compatibility before installing on production systems.
For this release we completely refactored low-level implementation of http handling.
Finally uvloop gives performance improvement. Overall performance improvement
should be around 70-90% compared to 1.x version.
We took opportunity to refactor long standing api design problem across whole package. Client exceptions handling has been cleaned up and now much more strait forward. Client payload management simplified and allows to extends with any custom types. Client collection pool implementation has been redesigned as well, now there is no need for actively releasing responses, aiohttp handles connection release automatically.
Another major change, we moved aiohttp development to public organization https://github.com/aio-libs
The aiohttp community would like to thank Keepsafe (https://www.getkeepsafe.com) for it's support in the early days of the project.
Alas we had to make backward incompatible changes. Please check this migration document http://aiohttp.readthedocs.io/en/latest/migration.html
Please report problems or annoyance with with api to https://github.com/aio-libs/aiohttp
You can install and test this release with::
pip install https://github.com/aio-libs/aiohttp/archive/2.0.0rc1.tar.gz#egg=aiohttp-2.0.0rc1
Fixed None timeout support #1720
Silence deprecation warning in __repr__ #1690
Revert timeout handling in client request
Fix StreamResponse representation after eof
Fix file_sender to not fall on bad request (range out of file size)
Fix file_sender to correct stream video to Chromes
Fix NotImplementedError server exception #1703
Clearer error message for URL without a host name. #1691
Silence deprecation warning in repr #1690
IDN + HTTPS = ssl.CertificateError #1685
Fixed memory leak in time service #1656
Awaiting on WebSocketResponse.send_\* does not work #1645
Handle CLOSING in WebSocketResponse.__anext__
WebSocketResponse.__anext__Deprecated: aiohttp.protocol.HttpPrefixParser will be removed in 1.4 #1590
FormData fields #916: or @ in a route does not work #1552receive_timeout timeout for websocket to receive complete message. #1325heartbeat parameter for websocket to automatically send ping message. #1024 #777web.Application dependency from web.UrlDispatcher #1510setsockopt may raise OSError exception if socket is closed already #1595text() method #1542http.cookies for python3.4.2 #1566RuntimeError is websocket connection is closed.aiohttp.protocol.HttpPrefixParser
will be removed in 1.4 #1590.started, .start() and .can_start() method
will be removed in 1.4 #1591sub app via app.router.add_subapp() is deprecated
use app.add_subapp() instead, will be removed in 1.4 #1592Application.finish() and Application.register_on_finish()
will be removed in 1.4 #1602Drop TestClient.app property, use TestClient.server.app instead (BACKWARD INCOMPATIBLE)
BaseRequest from web.Request, introduce web.Server
(former RequestHandlerFactory), introduce new low-level web server
which is not coupled with web.Application and routing #1362TestServer.make_url compatible with yarl.URL #1389TestClient.app property, use TestClient.server.app instead
(BACKWARD INCOMPATIBLE)TestClient.handler property, use TestClient.server.handler instead
(BACKWARD INCOMPATIBLE)TestClient.server property returns a test server instance, was
asyncio.AbstractServer (BACKWARD INCOMPATIBLE)Gunicorn[UVLoop]WebWorker #1201Gunicorn[UVLoop]WebWorker #1202Content-Length header in web.Response if no body
was set #1400router.post_init() for solving #1373TimeServive.stop()RuntimeError when trying to change the status of the HTTP response
after the headers have been sent #1480Fix BodyPartReader.read_chunk bug about returns zero bytes before EOF (#1428 _)
Fix BodyPartReader.read_chunk bug about returns zero bytes before EOF (#1428)
Fix static file serving in fallback mode (#1401 _)
Fix static file serving in fallback mode (#1401)
Make TestServer.make_url compatible with yarl.URL #1389
Bugfix release.
TestServer.make_url compatible with yarl.URL #1389Make TestServer.make_url compatible with yarl.URL (#1389)
Generate informative exception on redirects from server which does not provide redirection headers (#1396)
Support _root_ resources for sub-applications #1379
Allow starting variables with an underscore #1379
Bugfix release.
Fixed bugs:
FrozenListFix documentation generation #1120
Drop deprecated WSClientDisconnectedError (BACKWARD INCOMPATIBLE)
Drop deprecated WSClientDisconnectedError (BACKWARD INCOMPATIBLE)
Use yarl.URL in client API. The change is 99% backward compatible
but ClientResponse.url is an yarl.URL instance now. #1217
Close idle keep-alive connections on shutdown #1222
Modify regex in AccessLogger to accept underscore and numbers #1225
Use yarl.URL in web server API. web.Request.rel_url and
web.Request.url are added. URLs and templates are percent-encoded
now. #1224
Accept yarl.URL by server redirections #1278
Return yarl.URL by .make_url() testing utility #1279
Properly format IPv6 addresses by aiohttp.web.run_app #1139
Use yarl.URL by server API #1288
resource.url_for(), deprecate resource.url().StaticResource.SystemRoute from AbstractRouteRoute, PlainRoute, DynamicRoute,
StaticRoute, ResourceAdapter.Revert resp.url back to str, introduce resp.url_obj #1292
Raise ValueError if BasicAuth login has a ":" character #1307
Fix bug when ClientRequest send payload file with opened as open('filename', 'r+b') #1306
Enhancement to AccessLogger (pass extra dict) #1303
Show more verbose message on import errors #1319
Added save and load functionality for CookieJar #1219
Added option on StaticRoute to follow symlinks #1299
Force encoding of application/json content type to utf-8 #1339
Fix invalid invocations of errors.LineTooLong #1335
Websockets: Stop async for iteration when connection is closed #1144
Ensure TestClient HTTP methods return a context manager #1318
Raise ClientDisconnectedError to FlowControlStreamReader read function
if ClientSession object is closed by client when reading data. #1323
Document deployment without Gunicorn #1120
Add deprecation warning for MD5 and SHA1 digests when used for fingerprint of site certs in TCPConnector. #1186
Implement sub-applications #1301
Don't inherit web.Request from dict but implement
MutableMapping protocol.
Implement frozen signals
Don't inherit web.Application from dict but implement
MutableMapping protocol.
Support freezing for web applications
Accept access_log parameter in web.run_app, use None to disable logging
Don't flap tcp_cork and tcp_nodelay in regular request handling.
tcp_nodelay is still enabled by default.
Improve performance of web server by removing premature computing of
Content-Type if the value was set by web.Response constructor.
While the patch boosts speed of trivial web.Response(text='OK', content_type='text/plain) very well please don't expect significant
boost of your application -- a couple DB requests and business logic
is still the main bottleneck.
Boost performance by adding a custom time service #1350
Extend ClientResponse with content_type and charset
properties like in web.Request. #1349
Disable aiodns by default #559
Don't flap tcp_cork in client code, use TCP_NODELAY mode by default.
Implement web.Request.clone() #1361
Fix StreamReader._read_nowait to return all available data up to the requested amount. It boosts a performance in edge cases #1297
Nothing published for this version
Make CookieJar compatible with 32-bit systems #1188
WSMsgType to web_ws.__all__, see #1200CookieJar ctor when called with loop=None #1203Restore aiohttp.web.MsgType alias for aiohttp.WSMsgType for sake of backward compatibility #1178
aiohttp.web.MsgType alias for aiohttp.WSMsgType for sake
of backward compatibility #1178text/html content type for displaying index pages by static
file handler.AssertionError in static file handling #1177%O and %b for static file handlingRestore aiohttp.web.MsgType alias for aiohttp.WSMsgType for sake of backward compatibility (#1178)
Tune alabaster schema.
Use text/html content type for displaying index pages by static file handler.
Fix AssertionError in static file handling (#1177)
Fix access log formats %O and %b for static file handling
Remove debug setting of GunicornWorker, use app.debug to control its debug-mode instead
Client cookies support was rewritten in backward incompatible manner to split cookies with the same name but belonging to different domains #1173
The first officially stable release.
We are working hard on aiohttp stability.
This release is tagged as 1.0 -- the library is mature enough for this.
Backward compatibility with previous releases is kept as usual.
Deprecation period is 1.5 years.
The list of changes is pretty long, but the most significant ones are:
Content-Length) now, they was upper-cased (CONTENT-LENGTH) in previous releases.aiohttp.Timeout is alias for async_timeout.timeoutProxyConnector is deprecated, regular methods like ClientSession.get() accepts proxy and proxy_auth parameters explicitly #998aiohttp.TCPConnector uses asynchronous DNS requests and cache for given DNS resolutions #1152app.router.add_get(), app.router.add_post() etc. #986Request has .multipart() methods for easy access to multipart encoded data #1067WebSocketResponse.wait_closed method (BACKWARD
INCOMPATIBLE)force parameter for ClientResponse.close
method (BACKWARD INCOMPATIBLE)proxy and proxy_auth params to client.get() and family,
deprecate ProxyConnector #998app.router.add_get(), app.router.add_post() etc. instead of
app.router.add_route() #986{FOO}e logger format is case-sensitive nowloop.is_close()
should be present)web.Application.on_startup() signal handler #1103Application.startup in GunicornWebWorker #1105GunicornWebWorker #1117Application(debug=True) instead #1121StreamReader.read_nowait is -1 from now #1150aiohttp.StreamReader is not inherited from asyncio.StreamReader from now
(BACKWARD INCOMPATIBLE) #1150multipart coroutine method for web Request object #1067Timeout class for sake of async_timeout external library.
aiohttp.Timeout is an alias for async_timeout.timeoutuse_dns_cache parameter of aiohttp.TCPConnector is True by
default (BACKWARD INCOMPATIBLE) #1152aiohttp.TCPConnector uses asynchronous DNS resolver if available by
default (BACKWARD INCOMPATIBLE) #1152ClientSession.cookies (BACKWARD INCOMPATIBLE) #1173AbstractCookieJar public API (BACKWARD INCOMPATIBLE) #1173Pin miltidict version to >=1.2.2,<2.0.0
Pin miltidict version to >=1.2.2,<2.0.0
It fixes a bug with broken multidict dependecy
Nothing published for this version
Do not filter cookies if unsafe flag provided #1005
Thanks to Misha Behersky for finding and fixing!
Bugfix release that introduces _usafe_ cookie jar which should not be used in production but very useful for test writing.
Bugfix release that introduces usafe cookie jar which should not be used in production but very useful for test writing.
aiohttp.__version__The release fixes a very annoying regression: client API was broken when code accepts cookie with expiration date larger than 24 days.
The release fixes a very annoying regression: client API was broken when code accepts cookie with expiration date larger than 24 days.
Update is highly recommended.
Large cookie expiration/max-age does not break an event loop from now (fixes (#967))
Drop deprecated share_cookies connector option (BACKWARD INCOMPATIBLE)
After long pause we proud to present new aiohttp major release.
web.run_app #832aiohttp.worker.GunicornUVLoopWebWorker #878request.payload property, use content instead.
(BACKWARD INCOMPATIBLE)Thanks to all for contributions!
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →