- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 33 for original (0.18 sec)
-
fastapi/utils.py
original_type = field.type_ if is_dataclass(original_type) and hasattr(original_type, "__pydantic_model__"): original_type = original_type.__pydantic_model__ use_type = original_type if lenient_issubclass(original_type, BaseModel): original_type = cast(Type[BaseModel], original_type) use_type = cloned_types.get(original_type) if use_type is None:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.8K bytes - Viewed (0) -
docs_src/custom_request_and_route/tutorial003.py
from fastapi.routing import APIRoute class TimedRoute(APIRoute): def get_route_handler(self) -> Callable: original_route_handler = super().get_route_handler() async def custom_route_handler(request: Request) -> Response: before = time.time() response: Response = await original_route_handler(request) duration = time.time() - before response.headers["X-Response-Time"] = str(duration)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 1K bytes - Viewed (0) -
docs_src/custom_request_and_route/tutorial002.py
from fastapi.routing import APIRoute class ValidationErrorLoggingRoute(APIRoute): def get_route_handler(self) -> Callable: original_route_handler = super().get_route_handler() async def custom_route_handler(request: Request) -> Response: try: return await original_route_handler(request) except RequestValidationError as exc: body = await request.body()
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 932 bytes - Viewed (0) -
docs/en/docs/how-to/custom-request-and-route.md
This time, it will overwrite the method `APIRoute.get_route_handler()`. This method returns a function. And that function is what will receive a request and return a response. Here we use it to create a `GzipRequest` from the original request. ```Python hl_lines="18-26" {!../../../docs_src/custom_request_and_route/tutorial001.py!} ``` !!! note "Technical Details"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Mar 31 23:52:53 GMT 2024 - 4.4K bytes - Viewed (0) -
docs/ko/docs/tutorial/cors.md
``` `CORSMiddleware` 에서 사용하는 기본 매개변수는 제한적이므로, 브라우저가 교차-도메인 상황에서 특정한 출처, 메소드, 헤더 등을 사용할 수 있도록 하려면 이들을 명시적으로 허용해야 합니다. 다음의 인자들이 지원됩니다: * `allow_origins` - 교차-출처 요청을 보낼 수 있는 출처의 리스트입니다. 예) `['https://example.org', 'https://www.example.org']`. 모든 출처를 허용하기 위해 `['*']` 를 사용할 수 있습니다. * `allow_origin_regex` - 교차-출처 요청을 보낼 수 있는 출처를 정규표현식 문자열로 나타냅니다. `'https://.*\.example\.org'`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Jan 07 14:21:23 GMT 2023 - 5.8K bytes - Viewed (0) -
docs/zh/docs/tutorial/cors.md
* `expose_headers` - 指示可以被浏览器访问的响应头。默认为 `[]`。 * `max_age` - 设定浏览器缓存 CORS 响应的最长时间,单位是秒。默认为 `600`。 中间件响应两种特定类型的 HTTP 请求…… ### CORS 预检请求 这是些带有 `Origin` 和 `Access-Control-Request-Method` 请求头的 `OPTIONS` 请求。 在这种情况下,中间件将拦截传入的请求并进行响应,出于提供信息的目的返回一个使用了适当的 CORS headers 的 `200` 或 `400` 响应。 ### 简单请求
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 27 17:28:07 GMT 2021 - 4.5K bytes - Viewed (0) -
docs/ja/docs/tutorial/cors.md
このミドルウェアは2種類のHTTPリクエストに応答します... ### CORSプリフライトリクエスト これらは、 `Origin` ヘッダーと `Access-Control-Request-Method` ヘッダーを持つ `OPTIONS` リクエストです。 この場合、ミドルウェアはリクエストを横取りし、適切なCORSヘッダーと共に情報提供のために `200` または `400` のレスポンスを返します。 ### シンプルなリクエスト `Origin` ヘッダーのあるリクエスト。この場合、ミドルウェアは通常どおりリクエストに何もしないですが、レスポンスに適切なCORSヘッダーを加えます。 ## より詳しい情報
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Oct 18 06:02:19 GMT 2020 - 6.3K bytes - Viewed (0) -
docs/fr/docs/project-generation.md
* Modèle de démarrages basiques pour les utilisateurs (à modifier et supprimer au besoin). * Migrations **Alembic**. * **CORS** (partage des ressources entre origines multiples, ou *Cross Origin Resource Sharing*). * *Worker* **Celery** pouvant importer et utiliser les modèles et le code du reste du backend.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jul 02 14:18:06 GMT 2021 - 6.7K bytes - Viewed (0) -
docs/en/docs/tutorial/middleware.md
But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations ([CORS (Cross-Origin Resource Sharing)](cors.md){.internal-link target=_blank}) using the parameter `expose_headers` documented in <a href="https://www.starlette.io/middleware/#corsmiddleware" class="external-link" target="_blank">Starlette's CORS docs</a>.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 2.9K bytes - Viewed (0) -
docs/de/docs/tutorial/middleware.md
s" class="external-link" target="_blank">Verwenden Sie dafür das Präfix 'X-'</a>. Wenn Sie jedoch benutzerdefinierte Header haben, die ein Client in einem Browser sehen soll, müssen Sie sie zu Ihrer CORS-Konfigurationen ([CORS (Cross-Origin Resource Sharing)](cors.md){.internal-link target=_blank}) hinzufügen, indem Sie den Parameter `expose_headers` verwenden, der in der <a href="https://www.starlette.io/middleware/#corsmiddleware" class="external-link" target="_blank">Starlette-CO...
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 23 11:26:59 GMT 2024 - 3.4K bytes - Viewed (0)