This commit is contained in:
louiscklaw
2025-01-31 22:33:28 +08:00
parent 2f92062c07
commit 5833d552e9
689 changed files with 7855 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/api/data")
def get_data():
data = {"name": "John", "age": 30, "city": "New York"}
return jsonify(data)
if __name__ == "__main__":
app.run()

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# curl -X POST -H "Content-Type: application/json" -d '{"name":"John Doe","age":30}' http://localhost:5000/api/data
curl http://localhost:5000/api/data