Update wrappers.py

for return json
This commit is contained in:
mouday 2023-07-08 17:30:54 +08:00 committed by GitHub
parent cb825687a5
commit 1b86606774
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,6 +110,14 @@ class Request(RequestBase):
return _split_blueprint_path(name) return _split_blueprint_path(name)
@property
def json(self):
"""
force return json, fix bug: if client not send data, this method will error
:return: json object
"""
return self.get_json(force=True)
def _load_form_data(self) -> None: def _load_form_data(self) -> None:
super()._load_form_data() super()._load_form_data()