Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 1,606 for response (0.09 sec)

  1. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial002_py310.py

    def test_create_item(client: TestClient) -> None:
        response = client.post("/items/", json={"name": "Foo"})
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Foo", "description": None}
    
    
    @needs_py310
    def test_read_items(client: TestClient) -> None:
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [
            {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 25 19:10:22 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  2. tests/test_security_http_bearer_optional.py

        response = client.get("/users/me", headers={"Authorization": "Basic notreally"})
        assert response.status_code == 200, response.text
        assert response.json() == {"msg": "Create an account first"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  3. tests/test_security_oauth2_authorization_code_bearer_description.py

    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_incorrect_token():
        response = client.get("/items", headers={"Authorization": "Non-existent testtoken"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  4. tests/test_security_oauth2_password_bearer_optional.py

    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 200, response.text
        assert response.json() == {"msg": "Create an account first"}
    
    
    def test_token():
        response = client.get("/items", headers={"Authorization": "Bearer testtoken"})
        assert response.status_code == 200, response.text
        assert response.json() == {"token": "testtoken"}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py39
    def test_no_token(client: TestClient):
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py39
    def test_token(client: TestClient):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Mar 13 19:07:10 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  6. docs/em/docs/advanced/additional-responses.md

    ///
    
    ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“ฃ ๐ŸŒ– ๐Ÿ“จ, โฎ๏ธ ๐ŸŒ– ๐Ÿ‘” ๐Ÿ“Ÿ, ๐Ÿ”‰ ๐Ÿ†Ž, ๐Ÿ“›, โ™’๏ธ.
    
    ๐Ÿ‘ˆ ๐ŸŒ– ๐Ÿ“จ ๐Ÿ”œ ๐Ÿ”Œ ๐Ÿ—„ ๐Ÿ”—, ๐Ÿ‘ซ ๐Ÿ”œ ๐Ÿ˜‘ ๐Ÿ› ๏ธ ๐Ÿฉบ.
    
    โœ‹๏ธ ๐Ÿ‘ˆ ๐ŸŒ– ๐Ÿ“จ ๐Ÿ‘† โœ”๏ธ โš’ ๐Ÿ’ญ ๐Ÿ‘† ๐Ÿ“จ `Response` ๐Ÿ’– `JSONResponse` ๐Ÿ”—, โฎ๏ธ ๐Ÿ‘† ๐Ÿ‘” ๐Ÿ“Ÿ & ๐ŸŽš.
    
    ## ๐ŸŒ– ๐Ÿ“จ โฎ๏ธ `model`
    
    ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšถโ€โ™€๏ธ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ‘จโ€๐ŸŽจ* ๐Ÿ”ข `responses`.
    
    โšซ๏ธ ๐Ÿ“จ `dict`, ๐Ÿ”‘ ๐Ÿ‘” ๐Ÿ“Ÿ ๐Ÿ”  ๐Ÿ“จ, ๐Ÿ’– `200`, & ๐Ÿ’ฒ ๐ŸŽ `dict`โ“‚ โฎ๏ธ โ„น ๐Ÿ”  ๐Ÿ‘ซ.
    
    ๐Ÿ”  ๐Ÿ‘ˆ ๐Ÿ“จ `dict`โ“‚ ๐Ÿ’ช โœ”๏ธ ๐Ÿ”‘ `model`, โš— Pydantic ๐Ÿท, ๐Ÿ’– `response_model`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial005.py

    
    def test_no_token():
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token():
        access_token = get_access_token(scope="me")
        response = client.get(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Mar 13 19:07:10 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  8. docs/features/interceptors.md

            request.url(), chain.connection(), request.headers()));
    
        Response response = chain.proceed(request);
    
        long t2 = System.nanoTime();
        logger.info(String.format("Received response for %s in %.1fms%n%s",
            response.request().url(), (t2 - t1) / 1e6d, response.headers()));
    
        return response;
      }
    }
    ```
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Feb 06 02:19:09 UTC 2022
    - 8.1K bytes
    - Viewed (0)
  9. docs/pt/docs/advanced/additional-responses.md

    Vocรช pode declarar um `response_model`, utilizando o cรณdigo de status padrรฃo `200` (ou um customizado caso vocรช precise), e depois adicionar informaรงรตes adicionais para esse mesmo retorno em `responses`, diretamente no esquema OpenAPI.
    
    O **FastAPI** manterรก as informaรงรตes adicionais do `responses`, e combinarรก com o esquema JSON do seu modelo.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_handling_errors/test_tutorial006.py

    
    def test_get_http_error():
        response = client.get("/items/3")
        assert response.status_code == 418, response.text
        assert response.json() == {"detail": "Nope! I don't like 3."}
    
    
    def test_get():
        response = client.get("/items/2")
        assert response.status_code == 200, response.text
        assert response.json() == {"item_id": 2}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 4K bytes
    - Viewed (0)
Back to top