Upgrading aiohttp 0.18 to 0.19
Breaking0.18.4 → 0.19.0Breaking2New13Changed4Fixed3
BreakingUpgrade verdict
2 breaking changes.
In plain terms
- Forbids passing both Content-Type header and content_type or charset params into web.Response constructor.
- Forbids duplicating web.Application and web.Request.
Must act 2 items need code or config changes
What you must change
Breaking2
Forbids passing both Content-Type header and content_type or charset params into web.Response constructor.
web.ResponseContent-Typecontent_typecharsetForbids duplicating web.Application and web.Request.
web.Applicationweb.RequestAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- changed:
method ClientSession.ws_connect(url, *, protocols=…, timeout=…, autoclose=…, autoping=…, auth=…) → method ClientSession.ws_connect(url, *, protocols=…, timeout=…, autoclose=…, autoping=…, auth=…, origin=…) - added:
function ws_connect(url, *, protocols=…, timeout=…, connector=…, auth=…, ws_response_class=…, autoclose=…, autoping=…, loop=…, origin=…)
- added:
class ClientRequest - added:
class ClientResponse - added:
constructor ClientRequest(method, url, *, params=…, headers=…, skip_auto_headers=…, data=…, cookies=…, auth=…, encoding=…, version=…, compress=…, chunked=…, expect100=…, loop=…, response_class=…) - added:
constructor ClientResponse(method, url, host=…, *, writer=…, continue100=…) - added:
field ClientRequest.ALL_METHODS - added:
field ClientRequest.DEFAULT_HEADERS - added:
field ClientRequest.GET_METHODS - added:
field ClientRequest.POST_METHODS - added:
field ClientRequest.SERVER_SOFTWARE - added:
field ClientRequest.auth - added:
field ClientRequest.body - added:
field ClientRequest.response - added:
field ClientRequest.response_class - added:
field ClientResponse.content - added:
field ClientResponse.cookies - added:
field ClientResponse.flow_control_class - added:
field ClientResponse.headers - added:
field ClientResponse.reason - added:
field ClientResponse.status - added:
field ClientResponse.version - added:
method ClientRequest.close() - added:
method ClientRequest.send(writer, reader) - added:
method ClientRequest.terminate() - added:
method ClientRequest.update_auth(auth) - added:
method ClientRequest.update_auto_headers(skip_auto_headers) - added:
method ClientRequest.update_body_from_data(data, skip_auto_headers) - added:
method ClientRequest.update_content_encoding() - added:
method ClientRequest.update_cookies(cookies) - added:
method ClientRequest.update_expect_continue(expect=…) - added:
method ClientRequest.update_headers(headers) - added:
method ClientRequest.update_host(url) - added:
method ClientRequest.update_path(params) - added:
method ClientRequest.update_transfer_encoding() - added:
method ClientRequest.update_version(version) - added:
method ClientRequest.write_bytes(request, reader) - added:
method ClientResponse.close(force=…) - added:
method ClientResponse.json(*, encoding=…, loads=…) - added:
method ClientResponse.read(decode=…) - added:
method ClientResponse.read_and_close(decode=…) - added:
method ClientResponse.release() - added:
method ClientResponse.start(connection, read_until_eof=…) - added:
method ClientResponse.text(encoding=…) - added:
method ClientResponse.wait_for_close() - added:
method ClientResponse.waiting_for_continue() - added:
property ClientResponse.connection - added:
property ClientResponse.history
- removed:
class BasicAuth(namedtuple('BasicAuth', ['login', 'password', 'encoding'])) - removed:
class FormData - removed:
constructor FormData(fields=…) - removed:
function parse_mimetype(mimetype) - removed:
method BasicAuth.encode() - removed:
method FormData.add_field(name, value, *, content_type=…, filename=…, content_transfer_encoding=…) - removed:
method FormData.add_fields(*fields) - removed:
property FormData.content_type - removed:
property FormData.is_multipart
- changed:
class ParserBuffer(bytearray) → class ParserBuffer - changed:
constructor StreamParser(*, loop=…, buf=…, limit=…, eof_exc_class=…) → constructor StreamParser(*, loop=…, buf=…, limit=…, eof_exc_class=…, **kwargs) - added:
method ParserBuffer.extend(data)
- added:
property HttpMessage.body_length
- added:
class ServerHttpProtocol(aiohttp.StreamProtocol) - added:
constructor ServerHttpProtocol(*, loop=…, keep_alive=…, keep_alive_on=…, timeout=…, logger=…, access_log=…, access_log_format=…, debug=…, log=…, **kwargs) - added:
method ServerHttpProtocol.cancel_slow_request() - added:
method ServerHttpProtocol.closing(timeout=…) - added:
method ServerHttpProtocol.connection_lost(exc) - added:
method ServerHttpProtocol.connection_made(transport) - added:
method ServerHttpProtocol.data_received(data) - added:
method ServerHttpProtocol.handle_error(status=…, message=…, payload=…, exc=…, headers=…, reason=…) - added:
method ServerHttpProtocol.handle_request(message, payload) - added:
method ServerHttpProtocol.keep_alive(val) - added:
method ServerHttpProtocol.log_access(message, environ, response, time) - added:
method ServerHttpProtocol.log_debug(*args, **kw) - added:
method ServerHttpProtocol.log_exception(*args, **kw) - added:
method ServerHttpProtocol.start() - added:
property ServerHttpProtocol.keep_alive_timeout
- added:
method Application.copy()
- changed:
constructor Response(*, body=…, status=…, reason=…, text=…, headers=…, content_type=…) → constructor Response(*, body=…, status=…, reason=…, text=…, headers=…, content_type=…, charset=…) - added:
function json_response(data=…, *, text=…, body=…, status=…, reason=…, headers=…, content_type=…, dumps=…) - added:
method Request.copy()
- added:
method UrlDispatcher.named_routes()
- removed:
function ws_connect(url, *, protocols=…, timeout=…, connector=…, auth=…, ws_response_class=…, autoclose=…, autoping=…, loop=…)
- added:
class GunicornWebWorker(base.Worker) - added:
constructor GunicornWebWorker(*args, **kw) - added:
method GunicornWebWorker.close() - added:
method GunicornWebWorker.handle_abort(sig, frame) - added:
method GunicornWebWorker.handle_quit(sig, frame) - added:
method GunicornWebWorker.init_process() - added:
method GunicornWebWorker.init_signal() - added:
method GunicornWebWorker.make_handler(app, host, port) - added:
method GunicornWebWorker.run()