blob: e876641fe9f3cd4f69ba62fdcf097c222f2fc275 (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
|
"""Utilities to deal with requests."""
import werkzeug
from flask import request
def request_json() -> dict:
"""Retrieve the JSON sent in a request."""
try:
return request.json
except werkzeug.exceptions.UnsupportedMediaType:
return dict(request.form) or {}
|