Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Duplicated from
dog/fastapi-hello-world
souljoy
/
my_api
like
0
Running
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
4d00c48
my_api
/
app.py
souljoy
Update app.py
4d00c48
almost 2 years ago
raw
Copy download link
history
blame
Safe
216 Bytes
from
flask
import
Flask, request
app = Flask(__name__)
@app.route(
'/json_example'
, methods=[
'POST'
]
)
def
handle_json
():
data = request.json
print
(data.get(
'name'
))
print
(data.get(
'age'
))
return
data