Skip to main content

ORJSONResponse

JSON response using the orjson 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 orjson library. This method is used internally to serialize the response body.

Parameters

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

Returns

TypeDescription
bytesThe content serialized as a JSON byte string.