In the process of working, I have met many questions, some had been solved that i may forget the method to solving the problem. Some have not been solved, so it’s necessary to write these problem and conquer when inspiration comes to me.
- When I used the package of Flask to buid my api, i sent a format of string to the api, but when the symbol '# ’ in the string, the front of the '# ’ is lefted and the behind of the ‘#’ is cut nowhere, the program is as follows:
def opinionAnalysis():
sentence = None
if request.method == "POST":
sentence = request.form.get("title")
else:
sentence = request.args.get("title")
oa = OpinionAnalysis(data_dir, model_dir)
return oa.unit_sample_test(sentence)
I have used resuest.form.get 、 request.args.getand request.values.get, but it made no use.
作者在工作中遇到诸多问题,部分已解决但可能遗忘解法,部分未解决。以Flask构建API为例,发送含'#'符号的字符串时,'#'后面内容被截断,尝试多种方法无果,并给出相关参考链接。
1795

被折叠的 条评论
为什么被折叠?



