From cffe8c8e31a4f37496d0a193939f0aeea8814d16 Mon Sep 17 00:00:00 2001 From: hipro Date: Fri, 8 Dec 2017 17:43:12 +0800 Subject: [PATCH] Update structure.rst --- docs/guide/structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/structure.rst b/docs/guide/structure.rst index b0735a17f..e9f9506c0 100644 --- a/docs/guide/structure.rst +++ b/docs/guide/structure.rst @@ -165,7 +165,7 @@ of form-encoding may override `~.RequestHandler.prepare` to parse their requests:: def prepare(self): - if self.request.headers["Content-Type"].startswith("application/json"): + if self.request.headers.get("Content-Type", "").startswith("application/json"): self.json_args = json.loads(self.request.body) else: self.json_args = None -- 2.47.2