JSON
class¶
Warning
The current page still doesn't have a translation for this language.
But you can help translating it: Contributing.
esmerald.JSON
¶
JSON(content=None, status_code=None, **kwargs)
Bases: ResponseContainer[JSONResponse]
Returns a wrapper of a JSONResponse.
PARAMETER | DESCRIPTION |
---|---|
content
|
TYPE:
|
status_code
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in esmerald/datastructures/json.py
44 45 46 47 48 49 50 51 52 53 |
|
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.
media_type
class-attribute
instance-attribute
¶
media_type = 'application/json'
The media type of the response.
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/json.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|