getting this error while running sanic_restful app
sanic - 19.12.2
python - 3.7.6 (anaconda env)
OS - Windows 10
class GetNLU(Resource):
parser = reqparse.RequestParser()
parser.add_argument('text', type=str, required=True, help='upload')
async def post(self,*args):
data = {}
data["success"] = False
data = parser.parse_args()
data["result"] = []
'''stuff'''
return data
api.add_resource(GetNLU, '/getnlu')
app.run("127.0.0.1",5000,debug=True)
error message :-
[2020-04-07 16:38:01 +0600] [10420] [INFO] Goin' Fast @ http://127.0.0.1:5000
[2020-04-07 16:38:01 +0600] [10420] [INFO] Starting worker [10420]
[2020-04-07 16:38:06 +0600] [10420] [ERROR] Exception occurred while handling uri: 'http://127.0.0.1:5000/getnlu'
Traceback (most recent call last):
File "C:\Users\Raihan\Anaconda3\envs\tf_gpu\lib\site-packages\sanic\app.py", line 974, in handle_request
response = await response
File "C:\Users\Raihan\Anaconda3\envs\tf_gpu\lib\site-packages\sanic_restful_api\__init__.py", line 137, in wrapper
resp = await resource(request, *args, **kwargs)
File "C:\Users\Raihan\Anaconda3\envs\tf_gpu\lib\site-packages\sanic_restful_api\__init__.py", line 282, in dispatch_request
resp = await meth(request, *args, **kwargs)
File "C:\Users\Raihan\Desktop\nlu-api\code\app\rasa\get_model.py", line 18, in post
data = GetNLU.parser.parse_args()
TypeError: parse_args() missing 1 required positional argument: 'request'
[2020-04-07 16:38:06 +0600] - (sanic.access)[INFO][127.0.0.1:50991]: POST http://127.0.0.1:5000/getnlu 500 2003
[2020-04-07 16:38:11 +0600] [10420] [DEBUG] KeepAlive Timeout. Closing connection.