UJSON
class¶
esmerald.datastructures.encoders.UJSON
¶
UJSON(content=None, status_code=None, **kwargs)
Bases: ResponseContainer[UJSONResponse]
PARAMETER | DESCRIPTION |
---|---|
content
|
TYPE:
|
status_code
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in esmerald/datastructures/encoders.py
110 111 112 113 114 115 116 117 118 |
|
media_type
class-attribute
instance-attribute
¶
media_type = 'application/json'
The media type of the response.
content
class-attribute
instance-attribute
¶
content = content
The content being sent to the response.
status_code
class-attribute
instance-attribute
¶
status_code = status_code
The status code of the response. It will default to the handler if none is provided.
to_response
¶
to_response(headers, media_type, status_code, app)
PARAMETER | DESCRIPTION |
---|---|
headers
|
TYPE:
|
media_type
|
TYPE:
|
status_code
|
TYPE:
|
app
|
TYPE:
|
Source code in esmerald/datastructures/encoders.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|