(self)
| 313 | |
| 314 | @property |
| 315 | def json(self): |
| 316 | if not self.request.headers.get("Content-Type", "").startswith( |
| 317 | "application/json" |
| 318 | ): |
| 319 | raise APIError(400, "Invalid Content-Type, expected application/json.") |
| 320 | try: |
| 321 | return json.loads(self.request.body.decode()) |
| 322 | except Exception as e: |
| 323 | raise APIError(400, f"Malformed JSON: {e}") |
| 324 | |
| 325 | @property |
| 326 | def filecontents(self): |
no test coverage detected