OrJSON
class¶
esmerald.datastructures.encoders.OrJSON
¶
OrJSON(content=None, status_code=None, **kwargs)
Bases: ResponseContainer[ORJSONResponse]
PARAMETER | DESCRIPTION |
---|---|
content |
TYPE:
|
status_code |
TYPE:
|
**kwargs |
TYPE:
|
Source code in esmerald/datastructures/encoders.py
49 50 51 52 53 54 55 56 57 |
|
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
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|