api = Flask(__name__)
@api.route('/entities', methods=['GET'])
def entities():
text = request.args.get('text')
entities = str(nlu.entities(text))
return entities
http://0.0.0.0:5000/entities?text=#test
The symbol # cause the problem, in which 'text' is empty inside:
text = request.args.get('text')
I want to use urlencode to deal with special characters. But where to use it? This is for a http service call. Should I expect the client to encode the URL before it calls the URL?
http://0.0.0.0:5000/entities?text=#test
Is there a way in my Flask backend to handle these special characters, in case clients haven't encode it properly?