Closed as-ghub closed 5 years ago
Please log the value of request.data.
What is its type? I suspect you're passing bytes instead of unicode.
Thanks for the hint @mpenkov . I changed the code this way and it worked.
@app.route('/', methods = ['POST'])
def api_message():
text=request.data.strip().decode('utf-8')
return summarize(text)
app.run()
I am trying to build a python API for the first time. Trying to build an API end point to summarize using flask rest and gensim libraries. Any suggestions?
Code:
Expected output:
Actual output: