mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-13 07:41:06 -05:00
10 lines
230 B
Python
10 lines
230 B
Python
from fastapi import FastAPI, Request
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/{item_id}")
|
|
def read_root(item_id: str, request: Request):
|
|
client_host = request.client.host
|
|
return {"client_host": client_host, "item_id": item_id}
|