Skip to main content

ORJSONResponse

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

Constructor

Signature

def ORJSONResponse() - > null

Methods


render()

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

Serializes the provided content into JSON bytes using the orjson library with support for non-string keys and NumPy arrays.

Parameters

NameTypeDescription
contentAnyThe Python object to be serialized into JSON format

Returns

TypeDescription
bytesA UTF-8 encoded byte string containing the serialized JSON data