http://127.0.0.1:3000/segment?text=PA++
text = request.args.get('text')
What I get is 'PA', not 'PA++'.
How to not lose the plus signs in URL? I want to use urllib.urlencode(text) to encode it somehow, but how to get a handle of the 'text' string? because it comes from the request.args.get() function. By the time it returns the values, the special characters are already chopped off.
EDITED:
@api.route('/segment', methods=['GET'])
def segment():
text = request.args.get('text')
seg = str(segmenter.segment(text))
return seg
I don't have any html page or template. Then in the browser, I can make reqeust:
http://0.0.0.0:5000/segment?text=PA++
But the problem is:
text = request.args.get('text')
the returned 'text' is already reduced to 'PA', no plus sign.