Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1011 - 1020 of 1,929 for FastAPI (0.09 sec)

  1. docs/zh/docs/advanced/custom-response.md

    在这个例子中,HTTP 头的 `Content-Type` 会被设置成 `application/json`。
    
    并且在 OpenAPI 文档中也会这样记录。
    
    ///
    
    /// tip | "小贴士"
    
    `ORJSONResponse` 目前只在 FastAPI 中可用,而在 Starlette 中不可用。
    
    ///
    
    ## HTML 响应
    
    使用 `HTMLResponse` 来从 **FastAPI** 中直接返回一个 HTML 响应。
    
    * 导入 `HTMLResponse`。
    * 将 `HTMLResponse` 作为你的 *路径操作* 的 `response_class` 参数传入。
    
    ```Python hl_lines="2 7"
    {!../../docs_src/custom_response/tutorial002.py!}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  2. docs/pt/docs/tutorial/request_files.md

    ```Python
    contents = myfile.file.read()
    ```
    
    /// note | Detalhes técnicos do `async`
    
    Quando você utiliza métodos assíncronos, o **FastAPI** executa os métodos do arquivo em uma threadpool e espera por eles.
    
    ///
    
    /// note | Detalhes técnicos do Starlette
    
    O `UploadFile` do **FastAPI** herda diretamente do `UploadFile` do **Starlette**, mas adiciona algumas funcionalidades necessárias para ser compatível com o **Pydantic**
    
    ///
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  3. fastapi/background.py

        sent to the client.
    
        Read more about it in the
        [FastAPI docs for Background Tasks](https://fastapi.tiangolo.com/tutorial/background-tasks/).
    
        ## Example
    
        ```python
        from fastapi import BackgroundTasks, FastAPI
    
        app = FastAPI()
    
    
        def write_notification(email: str, message=""):
            with open("log.txt", mode="w") as email_file:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  4. fastapi/exceptions.py

        errors in your code.
    
        Read more about it in the
        [FastAPI docs for Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/).
    
        ## Example
    
        ```python
        from fastapi import FastAPI, HTTPException
    
        app = FastAPI()
    
        items = {"foo": "The Foo Wrestlers"}
    
    
        @app.get("/items/{item_id}")
        async def read_item(item_id: str):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_custom_response/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_get_custom_response():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.path_operation_advanced_configuration.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1020 bytes
    - Viewed (0)
  7. docs/ko/docs/features.md

    * 상용 어플리케이션에서의 사용.
    
    ## Starlette 기능
    
    **FastAPI**는 <a href="https://www.starlette.io/" class="external-link" target="_blank"><strong>Starlette</strong></a>를 기반으로 구축되었으며, 이와 완전히 호환됩니다. 따라서, 여러분이 보유하고 있는 어떤 추가적인 Starlette 코드도 작동할 것입니다.
    
    `FastAPI`는 실제로 `Starlette`의 하위 클래스입니다. 그래서, 여러분이 이미 Starlette을 알고 있거나 사용하고 있으면, 대부분의 기능이 같은 방식으로 작동할 것입니다.
    
    **FastAPI**를 사용하면 여러분은 **Starlette**의 기능 대부분을 얻게 될 것입니다(FastAPI가 단순히 Starlette를 강화했기 때문입니다):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/first-steps.md

    `FastAPI` is a class that inherits directly from `Starlette`.
    
    You can use all the <a href="https://www.starlette.io/" class="external-link" target="_blank">Starlette</a> functionality with `FastAPI` too.
    
    ///
    
    ### Step 2: create a `FastAPI` "instance"
    
    {* ../../docs_src/first_steps/tutorial001.py hl[3] *}
    
    Here the `app` variable will be an "instance" of the class `FastAPI`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 26 11:48:16 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/body.md

    /// note | "Заметка"
    
    FastAPI понимает, что значение параметра `q` не является обязательным, потому что имеет значение по умолчанию `= None`.
    
    Аннотация `Optional` в `Optional[str]` не используется FastAPI, но помогает вашему редактору лучше понимать ваш код и обнаруживать ошибки.
    
    ///
    
    ## Без Pydantic
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  10. tests/test_openapi_separate_input_output_schemas.py

    from typing import List, Optional
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    from .utils import PYDANTIC_V2, needs_pydanticv2
    
    
    class SubItem(BaseModel):
        subname: str
        sub_description: Optional[str] = None
        tags: List[str] = []
        if PYDANTIC_V2:
            model_config = {"json_schema_serialization_defaults_required": True}
    
    
    class Item(BaseModel):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 19.7K bytes
    - Viewed (0)
Back to top