Example:
languages = [{'name' : 'JavaScript'}, {'name' : 'Python'}, {'name' : 'Ruby'}]
@app.route('/lang', methods=['POST'])
def addOne():
language = {'name' : request.json['name']}
languages.append(language)
return jsonify({'languages' : languages})
Test:
171.232.89.174/lang
Method: Post
Headers: Content-Type:application/json
body: Raw : {"name" : "HUydada"}
Result :
<title>500 Internal Server Error</title>
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
But I test success on localhost IP.
Example:
languages = [{'name' : 'JavaScript'}, {'name' : 'Python'}, {'name' : 'Ruby'}]
@app.route('/lang', methods=['POST'])
def addOne():
language = {'name' : request.json['name']}
languages.append(language)
return jsonify({'languages' : languages})
Test:
<title>500 Internal Server Error</title>171.232.89.174/lang
Method: Post
Headers: Content-Type:application/json
body: Raw : {"name" : "HUydada"}
Result :
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
But I test success on localhost IP.