- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for context (0.42 sec)
-
docs_src/templates/tutorial001.py
@app.get("/items/{id}", response_class=HTMLResponse) async def read_item(request: Request, id: str): return templates.TemplateResponse( request=request, name="item.html", context={"id": id}
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Dec 26 20:12:34 GMT 2023 - 521 bytes - Viewed (0) -
docs_src/response_headers/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 309 bytes - Viewed (0) -
docs_src/response_cookies/tutorial001.py
from fastapi import FastAPI from fastapi.responses import JSONResponse app = FastAPI() @app.post("/cookie/") def create_cookie(): content = {"message": "Come to the dark side, we have cookies"} response = JSONResponse(content=content) response.set_cookie(key="fakesession", value="fake-cookie-session-value")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 344 bytes - Viewed (0) -
docs_src/response_directly/tutorial001.py
description: Union[str, None] = None app = FastAPI() @app.put("/items/{id}") def update_item(id: str, item: Item): json_compatible_item_data = jsonable_encoder(item)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 505 bytes - Viewed (0) -
docs_src/request_forms_and_files/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 317 bytes - Viewed (0) -
docs_src/websockets/tutorial001.py
ws.onmessage = function(event) { var messages = document.getElementById('messages') var message = document.createElement('li') var content = document.createTextNode(event.data) message.appendChild(content) messages.appendChild(message) }; function sendMessage(event) { var input = document.getElementById("messageText")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 1.4K bytes - Viewed (0) -
docs_src/custom_request_and_route/tutorial001.py
class GzipRequest(Request): async def body(self) -> bytes: if not hasattr(self, "_body"): body = await super().body() if "gzip" in self.headers.getlist("Content-Encoding"): body = gzip.decompress(body) self._body = body return self._body class GzipRoute(APIRoute): def get_route_handler(self) -> Callable:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 973 bytes - Viewed (0) -
docs_src/async_sql_databases/tutorial001.py
engine = sqlalchemy.create_engine( DATABASE_URL, connect_args={"check_same_thread": False} ) metadata.create_all(engine) class NoteIn(BaseModel): text: str completed: bool class Note(BaseModel): id: int text: str completed: bool app = FastAPI() @app.on_event("startup") async def startup(): await database.connect() @app.on_event("shutdown")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 1.4K bytes - Viewed (0) -
docs_src/additional_responses/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Aug 26 13:32:30 GMT 2022 - 506 bytes - Viewed (0) -
docs_src/additional_status_codes/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 684 bytes - Viewed (0)