toJSON() toJSON() : array Creates a JSON representation of this request. Returns array — a PHP array which can be passed to the 'json_encode' PHP method.