from fastapi import FastAPI, Cookie
app = FastAPI()
@app.get("/cookie")
def get_cookies(ga: str = Cookie(None)):
return {"ga": ga}
from fastapi import FastAPI, Header
app = FastAPI()
@app.get("/header")
def get_headers(x_token: str = Header(None, title="토큰")):
return {"X-Token": x_token}