Spaces:
Sleeping
Sleeping
File size: 481 Bytes
a9810af |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/modify_json', methods=['POST'])
def modify_json():
# Get JSON input from the request
input_json = request.get_json()
# Modify the JSON (for demonstration, simply adding a key 'modified' with value True)
input_json['modified'] = True
# Return modified JSON as response
return jsonify(input_json)
if __name__ == '__main__':
app.run(debug=True) # Run the app in debug mode
|