Tornado 6.5 Documentation
for non-template-based output; it accepts strings, bytes, and dictionaries (dicts will be encoded as JSON). Many methods in RequestHandler are designed to be overridden in subclasses and be used throughout form arguments with other types of input. In particular, we do not parse JSON request bodies. Applications that wish to use JSON instead of form-encoding may override prepare to parse their requests: 24 request.headers.get("Content-Type", "").startswith("application/json"): self.json_args = json.loads(self.request.body) else: self.json_args = None Overriding RequestHandler methods In addition to get()/post()/etc0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
for non-template-based output; it accepts strings, bytes, and dictionaries (dicts will be encoded as JSON). Many methods in RequestHandler are designed to be overridden in subclasses and be used throughout form arguments with other types of input. In particular, we do not parse JSON request bodies. Applications that wish to use JSON instead of form-encoding may override prepare to parse their requests: def headers.get("Content-Type", "").startswith("application/json"): self.json_args = json.loads(self.request.body) else: self.json_args = None Overriding RequestHandler methods In addition0 码力 | 437 页 | 405.14 KB | 2 月前3
共 2 条
- 1
相关搜索词