def ToJSonResponse(self, columns_order=None, order_by=(), req_id=<NUM_LIT:0>,<EOL>response_handler="<STR_LIT>"):
response_obj = {<EOL>"<STR_LIT:version>": "<STR_LIT>",<EOL>"<STR_LIT>": str(req_id),<EOL>"<STR_LIT>": self._ToJSonObj(columns_order, order_by),<EOL>"<STR_LIT:status>": "<STR_LIT>"<EOL>}<EOL>encoded_response_str = DataTableJSONEncoder().encode(response_obj)<EOL>if not isinstance(encoded_response_str, str):<EOL><INDENT>encoded_response_str = encoded_response_str.encode("<STR_LIT:utf-8>")<EOL><DEDENT>return "<STR_LIT>" % (response_handler, encoded_response_str)<EOL>
Writes a table as a JSON response that can be returned as-is to a client.

        This method writes a JSON response to return to a client in response to a
        Google Visualization API query. This string can be processed by the calling
        page, and is used to deliver a data table to a visualization hosted on
        a different page.

        Args:
          columns_order: Optional. Passed straight to self.ToJSon().
          order_by: Optional. Passed straight to self.ToJSon().
          req_id: Optional. The response id, as retrieved by the request.
          response_handler: Optional. The response handler, as retrieved by the
              request.

        Returns:
          A JSON response string to be received by JS the visualization Query
          object. This response would be translated into a DataTable on the
          client side.
          Example result (newlines added for readability):
           google.visualization.Query.setResponse({
              'version':'0.6', 'reqId':'0', 'status':'OK',
              'table': {cols: [...], rows: [...]}});

        Note: The URL returning this string can be used as a data source by Google
              Visualization Gadgets or from JS code.