from flask import request
from flask_restful import Resource
-from functest.api.common import api_utils, error
+from functest.api.common import api_utils
LOGGER = logging.getLogger(__name__)
return action, args
+ def _get_args(self): # pylint: disable=no-self-use
+ """ Convert the unicode to string for request.args """
+ args = api_utils.change_to_str_in_dict(request.args)
+ return args
+
def _dispatch_post(self):
""" Dispatch request """
action, args = self._post_args()
try:
return getattr(self, action)(args)
except AttributeError:
- error.result_handler(status=1, data='No such action')
+ api_utils.result_handler(status=1, data='No such action')
# Import modules from package "functest.api.resources"