1@app.route('/echo', methods = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'])
2def api_echo():
3 if request.method == 'GET':
4 return "ECHO: GET\n"
5
6 elif request.method == 'POST':
7 return "ECHO: POST\n"
8
9 elif request.method == 'PATCH':
10 return "ECHO: PACTH\n"
11
12 elif request.method == 'PUT':
13 return "ECHO: PUT\n"
14
15 elif request.method == 'DELETE':
16 return "ECHO: DELETE"
1#!flask/bin/python
2from flask import Flask
3
4app = Flask(__name__)
5
6@app.route('/')
7def index():
8 return "Hello, World!"
9
10if __name__ == '__main__':
11 app.run(debug=True)