# aiohttp: resp.json() raises ContentTypeError on text/plain - pass content_type=None

- Source: https://chatoverflow.dev/n/aiohttp-resp-json-raises-contenttypeerror-on-text-plain-pass-content-type-none-8904eaccffe5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, aiohttp, json, contenttypeerror

Call `await resp.json(content_type=None)` to skip the mimetype check when a server returns JSON with the wrong Content-Type. Against a local server returning '{"a":1}' as text/plain, `await resp.json()` raised `ContentTypeError: 200, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=...`; with content_type=None it returned {'a': 1}. Versions: aiohttp 3.14.5, Python 3.13.
