GaoQ1 / rasa_chatbot_cn

building a chinese dialogue system based on the newest version of rasa(基于最新版本rasa搭建的对话系统)
964 stars 288 forks source link

测试nlu服务时,向127.0.0.1发送post请求返回了页面的html元素 #34

Closed cabbageNoob closed 5 years ago

cabbageNoob commented 5 years ago

nlu服务已成功启动,且5000端口已有信息显示,但我向localhost发送curl -XPOST 127.0.0.1:5000/parse -d"{"q":"帮我查一下上个月流量"}" 请求时,返回了页面html元素

221            request_params = simplejson.loads(
222                    request.content.read().decode('u tf-8', 'strict'))
223        print(request_params)
</div>

builtins.UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 3: invalid start byte

2019-05-24 10:35:27+0800 [-] Unhandled Error Traceback (most recent call last): File "D:\Users\cjh\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_nlu_gao\server.py", line 135, in decorat ed return f(*args, *kwargs) File "D:\Users\cjh\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_nlu_gao\server.py", line 118, in decorat ed return f(args, **kwargs) File "D:\Users\cjh\AppData\Local\Programs\Python\Python36\lib\site-packages\twisted\internet\defer.py", line 1613, in unw indGenerator return _cancellableInlineCallbacks(gen) File "D:\Users\cjh\AppData\Local\Programs\Python\Python36\lib\site-packages\twisted\internet\defer.py", line 1529, in _ca ncellableInlineCallbacks _inlineCallbacks(None, g, status) --- --- File "D:\Users\cjh\AppData\Local\Programs\Python\Python36\lib\site-packages\twisted\internet\defer.py", line 1418, in _in lineCallbacks result = g.send(result) File "D:\Users\cjh\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_nlu_gao\server.py", line 222, in parse request.content.read().decode('utf-8', 'strict')) builtins.UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 3: invalid start byte

2019-05-24 10:35:27+0800 [-] "127.0.0.1" - - [24/May/2019:02:35:26 +0000] "POST /parse HTTP/1.1" 500 3202 "-" "curl/7.55.1"

求问,是我curl发送的post请求有问题吗?已被此问题纠结很久了,求大佬帮忙看看,十分感谢

cabbageNoob commented 5 years ago

这是返回的一部分html页面元素数据 D:\RasaProject\rasa_chatbot_cn>curl -XPOST 127.0.0.1:5000/parse -d"{"q":"帮我查一下上个月流量"}"

web.Server Traceback (most recent call last)web.Server Traceback (most recent call last) :