def _get_rest_doc(self, request, start_response):
api = request.body_json['<STR_LIT>']<EOL>version = request.body_json['<STR_LIT:version>']<EOL>generator = discovery_generator.DiscoveryGenerator(request=request)<EOL>services = [s for s in self._backend.api_services if<EOL>s.api_info.name == api and s.api_info.api_version == version]<EOL>doc = generator.pretty_print_config_to_json(services)<EOL>if not doc:<EOL><INDENT>error_msg = ('<STR_LIT>'<EOL>'<STR_LIT>') % (version, api)<EOL>_logger.error('<STR_LIT:%s>', error_msg)<EOL>return util.send_wsgi_error_response(error_msg, start_response)<EOL><DEDENT>return self._send_success_response(doc, start_response)<EOL>
Sends back HTTP response with API directory.

        This calls start_response and returns the response body.  It will return
        the discovery doc for the requested api/version.

        Args:
          request: An ApiRequest, the transformed request sent to the Discovery API.
          start_response: A function with semantics defined in PEP-333.

        Returns:
          A string, the response body.