def get_http_info(self):
"""
Determine how to retrieve actual data, basically if it's JSON or not.
"""
try:
is_json = request.is_json
except AttributeError:
is_json = request.get_json(silent=True) is not None
if is_json:
retriever = Breathalyzer.get_json_data
else:
retriever = Breathalyzer.get_form_data
return self.get_http_info_with_retriever(retriever)
评论列表
文章目录