Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Termfastapi get ip

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}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Termfastapi #ip
ADD COMMENT
Topic
Name
5+6 =