Search Options

Results per page
Sort
Preferred Languages
Advance

Results 591 - 600 of 1,127 for def2 (0.04 sec)

  1. docs/ja/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: str = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>または<code>async def</code>を使います...</summary>
    
    `async` / `await`を使用するときは、 `async def`を使います:
    
    ```Python hl_lines="7 12"
    from fastapi import FastAPI
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 20 19:20:23 UTC 2024
    - 21K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_header_params/test_tutorial001_an.py

            ("/items", {"User-Agent": "FastAPI test"}, 200, {"User-Agent": "FastAPI test"}),
        ],
    )
    def test(path, headers, expected_status, expected_response):
        response = client.get(path, headers=headers)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  3. docs/tr/docs/index.md

    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    <summary>Ya da <code>async def</code>...</summary>
    
    Eğer kodunuzda `async` / `await` varsa, `async def` kullanalım:
    
    ```Python hl_lines="9  14"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 16 16:50:01 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial001_an.py

            ("/users", 200, {"q": None, "skip": 0, "limit": 100}),
        ],
    )
    def test_get(path, expected_status, expected_response):
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    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 Jul 07 17:12:13 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dependencies/test_tutorial001.py

            ("/users", 200, {"q": None, "skip": 0, "limit": 100}),
        ],
    )
    def test_get(path, expected_status, expected_response):
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    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 Jul 07 17:12:13 UTC 2023
    - 7K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/HeadersJvmTest.kt

      @Test fun byteCount() {
        assertThat(EMPTY_HEADERS.byteCount()).isEqualTo(0L)
        assertThat(
          Headers.Builder()
            .add("abc", "def")
            .build()
            .byteCount(),
        ).isEqualTo(10L)
        assertThat(
          Headers.Builder()
            .add("abc", "def")
            .add("ghi", "jkl")
            .build()
            .byteCount(),
        ).isEqualTo(20L)
      }
    
      @Test fun addDate() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  7. docs_src/python_types/tutorial008b.py

    from typing import Union
    
    
    def process_item(item: Union[int, str]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 84 bytes
    - Viewed (0)
  8. docs_src/python_types/tutorial007_py39.py

    def process_items(items_t: tuple[int, int, str], items_s: set[bytes]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 99 bytes
    - Viewed (0)
  9. docs_src/app_testing/main.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 118 bytes
    - Viewed (0)
  10. docs_src/first_steps/tutorial001.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    async def root():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 117 bytes
    - Viewed (0)
Back to top