Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


API Interaction with Flask (Web Framework) filter_list
Author
Message
API Interaction with Flask (Web Framework) #1
from flask import Flask, jsonify

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

@app.route('/api/data', methods=['GET'])
def get_data():
    data = {'key': 'value'}
    return jsonify(data)

if __name__ == '__main__':
    app.run(debug=True)

Reply







Users browsing this thread: 1 Guest(s)