code: def ToJSonResponse(self, columns_order=None, order_by=(), req_id=0,
                       response_handler="google.visualization.Query.setResponse"):
      
  
      response_obj = {
          "version": "0.6",
          "reqId": str(req_id),
          "table": self._ToJSonObj(columns_order, order_by),
          "status": "ok"
      }
      encoded_response_str = DataTableJSONEncoder().encode(response_obj)
      if not isinstance(encoded_response_str, str):
        encoded_response_str = encoded_response_str.encode("utf-8")
      return "%s(%s);" % (response_handler, encoded_response_str)
docs: 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.