mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-09 09:26:50 +00:00
Explain how I justified to myself making JsonResource not always send JSON.
This commit is contained in:
parent
e9c908ebc0
commit
c5bf0343e8
1 changed files with 7 additions and 0 deletions
|
@ -79,6 +79,13 @@ class JsonResource(HttpServer, resource.Resource):
|
||||||
Resources.
|
Resources.
|
||||||
|
|
||||||
Register callbacks via register_path()
|
Register callbacks via register_path()
|
||||||
|
|
||||||
|
Callbacks can return a tuple of status code and a dict in which case the
|
||||||
|
the dict will automatically be sent to the client as a JSON object.
|
||||||
|
|
||||||
|
The JsonResource is primarily intended for returning JSON, but callbacks
|
||||||
|
may send something other than JSON, they may do so by using the methods
|
||||||
|
on the request object and instead returning None.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
isLeaf = True
|
isLeaf = True
|
||||||
|
|
Loading…
Add table
Reference in a new issue