Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for status_code (0.1 sec)

  1. docs/de/docs/tutorial/response-status-code.md

    # Response-Statuscode
    
    So wie ein Responsemodell, können Sie auch einen HTTP-Statuscode für die Response deklarieren, mithilfe des Parameters `status_code`, und zwar in jeder der *Pfadoperationen*:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * usw.
    
    {* ../../docs_src/response_status_code/tutorial001.py hl[6] *}
    
    /// note | "Hinweis"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 16:59:43 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/response-status-code.md

    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * etc.
    
    {* ../../docs_src/response_status_code/tutorial001.py hl[6] *}
    
    /// note
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Oct 28 11:13:18 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  3. fastapi/security/oauth2.py

            authorization = request.headers.get("Authorization")
            if not authorization:
                if self.auto_error:
                    raise HTTPException(
                        status_code=HTTP_403_FORBIDDEN, detail="Not authenticated"
                    )
                else:
                    return None
            return authorization
    
    
    class OAuth2PasswordBearer(OAuth2):
        """
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 23 18:30:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/additional-status-codes.md

    To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want:
    
    {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *}
    
    /// warning
    
    When you return a `Response` directly, like in the example above, it will be returned directly.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 16:12:23 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  5. docs/pt/docs/advanced/custom-response.md

    ```
    
    Se você fizer isso, então você pode retornar a URL diretamente da sua *função de operação de rota*
    
    Neste caso, o `status_code` utilizada será o padrão de `RedirectResponse`, que é `307`.
    
    ---
    
    Você também pode utilizar o parâmetro `status_code` combinado com o parâmetro `response_class`:
    
    ```Python hl_lines="2  7  9"
    {!../../docs_src/custom_response/tutorial006c.py!}
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 29 11:47:10 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  6. docs/ko/docs/advanced/response-change-status-code.md

    이런 경우에는 `Response` 파라미터를 사용할 수 있습니다.
    
    ## `Response` 파라미터 사용하기
    
    *경로 작동 함수*에 `Response` 타입의 파라미터를 선언할 수 있습니다. (쿠키와 헤더에 대해 선언하는 것과 유사하게)
    
    그리고 이 *임시* 응답 객체에서 `status_code`를 설정할 수 있습니다.
    
    ```Python hl_lines="1  9  12"
    {!../../docs_src/response_change_status_code/tutorial001.py!}
    ```
    
    그리고 평소처럼 원하는 객체(`dict`, 데이터베이스 모델 등)를 반환할 수 있습니다.
    
    `response_model`을 선언했다면 반환된 객체는 여전히 필터링되고 변환됩니다.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 22:01:39 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/additional-responses.md

    ///
    
    ## Combining information
    
    You can also combine response information from multiple places, including the `response_model`, `status_code`, and `responses` parameters.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 16:07:07 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  8. fastapi/dependencies/utils.py

    ) -> SolvedDependency:
        values: Dict[str, Any] = {}
        errors: List[Any] = []
        if response is None:
            response = Response()
            del response.headers["content-length"]
            response.status_code = None  # type: ignore
        dependency_cache = dependency_cache or {}
        sub_dependant: Dependant
        for sub_dependant in dependant.dependencies:
            sub_dependant.call = cast(Callable[..., Any], sub_dependant.call)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 21:46:26 UTC 2024
    - 34.7K bytes
    - Viewed (0)
  9. docs/en/docs/release-notes.md

        try:
            yield "Rick"
        except OwnerError as e:
            raise HTTPException(status_code=400, detail=f"Owner error: {e}")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id not in data:
            raise HTTPException(status_code=404, detail="Item not found")
        item = data[item_id]
        if item["owner"] != username:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Nov 01 11:25:57 UTC 2024
    - 460.3K bytes
    - Viewed (0)
  10. cmd/warm-backend-azure.go

    		// We don't interpret non Azure errors. As azure errors will
    		// have StatusCode to help to convert to object errors.
    		return err
    	}
    
    	serviceCode := azureErr.ErrorCode
    	statusCode := azureErr.StatusCode
    
    	return azureCodesToObjectError(err, serviceCode, statusCode, bucket, object)
    }
    
    func azureCodesToObjectError(err error, serviceCode string, statusCode int, bucket string, object string) error {
    	switch serviceCode {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 7K bytes
    - Viewed (0)
Back to top