Skip to main content

UJSONResponse

JSON response using the ujson library to serialize data to JSON.

Methods


render()

@classmethod
def render(
content: Any
) - > bytes

Renders the provided content into a JSON byte string using the ujson library. This method is used internally to serialize the response body before sending it.

Parameters

NameTypeDescription
contentAnyThe data to be serialized into JSON. This can be any Python object that ujson can serialize.

Returns

TypeDescription
bytesThe content serialized as a UTF-8 encoded JSON byte string.