- Sort Score
- Num 10 results
- Language All
Results 71 - 80 of 464 for status_code (0.13 seconds)
-
fastapi/security/open_id_connect_url.py
) self.scheme_name = scheme_name or self.__class__.__name__ self.auto_error = auto_error def make_not_authenticated_error(self) -> HTTPException: return HTTPException( status_code=HTTP_401_UNAUTHORIZED, detail="Not authenticated", headers={"WWW-Authenticate": "Bearer"}, ) async def __call__(self, request: Request) -> str | None:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 16 10:16:48 GMT 2026 - 3.1K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/custom-response.md
--- 或者你可以在 `response_class` 參數中使用它: {* ../../docs_src/custom_response/tutorial006b_py310.py hl[2,7,9] *} 若這麼做,你就可以在「路徑操作函式」中直接回傳 URL。 在此情況下,所使用的 `status_code` 會是 `RedirectResponse` 的預設值 `307`。 --- 你也可以同時搭配 `status_code` 與 `response_class` 參數: {* ../../docs_src/custom_response/tutorial006c_py310.py hl[2,7,9] *} ### `StreamingResponse` { #streamingresponse }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 10.3K bytes - Click Count (0) -
docs/ja/docs/advanced/additional-status-codes.md
たとえば、item を更新でき、成功時に HTTP ステータスコード 200 "OK" を返す *path operation* を作りたいとします。 しかし、新しい item も受け付けたいとします。そして、item が以前存在しなかった場合には作成し、HTTP ステータスコード 201「Created」を返します。 これを実現するには、`JSONResponse` をインポートし、望む `status_code` を設定して、そこで内容を直接返します。 {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *} /// warning 上の例のように `Response` を直接返すと、それはそのまま返されます。 モデルなどによってシリアライズされません。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 2.4K bytes - Click Count (0) -
docs/en/docs/tutorial/path-operation-configuration.md
Notice that these parameters are passed directly to the *path operation decorator*, not to your *path operation function*. /// ## Response Status Code { #response-status-code } You can define the (HTTP) `status_code` to be used in the response of your *path operation*. You can pass directly the `int` code, like `404`. But if you don't remember what each number code is for, you can use the shortcut constants in `status`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4K bytes - Click Count (0) -
tests/main.py
return f"foo bar {query}" @app.get("/query/param-required/int") def get_query_param_required_type(query: int = Query()): return f"foo bar {query}" @app.get("/enum-status-code", status_code=http.HTTPStatus.CREATED) def get_enum_status_code(): return "foo bar" @app.get("/query/frozenset") def get_query_type_frozenset(query: frozenset[int] = Query(...)):Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 4.5K bytes - Click Count (0) -
docs/en/docs/advanced/path-operation-advanced-configuration.md
{* ../../docs_src/path_operation_advanced_configuration/tutorial004_py310.py hl[17:27] *} ## Additional Responses { #additional-responses } You probably have seen how to declare the `response_model` and `status_code` for a *path operation*. That defines the metadata about the main response of a *path operation*. You can also declare additional responses with their models, status codes, etc.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 7.1K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/path-operation-configuration.md
# 路徑操作設定 { #path-operation-configuration } 你可以在你的「路徑操作裝飾器」中傳入多個參數來進行設定。 /// warning | 警告 請注意,這些參數是直接傳給「路徑操作裝飾器」,而不是傳給你的「路徑操作函式」。 /// ## 回應狀態碼 { #response-status-code } 你可以為「路徑操作」的回應設定 (HTTP) `status_code`。 你可以直接傳入整數代碼,例如 `404`。 如果不記得每個數字代碼代表什麼,你可以使用 `status` 中的速記常數: {* ../../docs_src/path_operation_configuration/tutorial001_py310.py hl[1,15] *} 該狀態碼會用於回應,並被加入至 OpenAPI 結構描述中。 /// note | 技術細節Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3.8K bytes - Click Count (0) -
docs/ko/docs/advanced/path-operation-advanced-configuration.md
문서에는 표시되지 않지만, Sphinx 같은 다른 도구는 나머지 부분을 사용할 수 있습니다. {* ../../docs_src/path_operation_advanced_configuration/tutorial004_py310.py hl[17:27] *} ## 추가 응답 { #additional-responses } *경로 처리*에 대해 `response_model`과 `status_code`를 선언하는 방법을 이미 보셨을 것입니다. 이는 *경로 처리*의 기본 응답에 대한 메타데이터를 정의합니다. 모델, 상태 코드 등과 함께 추가 응답도 선언할 수 있습니다. 이에 대한 문서의 전체 장이 있으니, [OpenAPI의 추가 응답](additional-responses.md)에서 읽어보세요. ## OpenAPI Extra { #openapi-extra }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 7.6K bytes - Click Count (0) -
docs/ja/docs/tutorial/path-operation-configuration.md
/// warning | 注意 これらのパラメータは*path operationデコレータ*に直接渡され、*path operation関数*に渡されないことに注意してください。 /// ## レスポンスステータスコード { #response-status-code } *path operation*のレスポンスで使用する(HTTP)`status_code`を定義することができます。 `404`のように`int`のコードを直接渡すことができます。 しかし、それぞれの番号コードが何のためのものか覚えていない場合は、`status`のショートカット定数を使用することができます: {* ../../docs_src/path_operation_configuration/tutorial001_py310.py hl[1,15] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 4.8K bytes - Click Count (0) -
fastapi/security/http.py
return {"WWW-Authenticate": f"{self.model.scheme.title()}"} def make_not_authenticated_error(self) -> HTTPException: return HTTPException( status_code=HTTP_401_UNAUTHORIZED, detail="Not authenticated", headers=self.make_authenticate_headers(), ) async def __call__(self, request: Request) -> HTTPAuthorizationCredentials | None:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 16 10:16:48 GMT 2026 - 13.1K bytes - Click Count (0)