cgi package is deprecated since Python 3.11, and will be removed in Python 3.13.
Alternative for cgi.parse_header:
from email.message import EmailMessage
msg = EmailMessage()
msg['content-type'] = 'application/json; charset="utf8"'
content_type = msg.get_content_type()