Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 210 for headers (0.18 sec)

  1. tests/test_repeated_cookie_headers.py

    client = TestClient(app)
    
    
    def test_cookie_is_set_once():
        direct_response = client.get("/directCookie")
        indirect_response = client.get("/indirectCookie")
        assert (
            direct_response.headers["set-cookie"] == indirect_response.headers["set-cookie"]
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Jun 13 12:44:51 GMT 2020
    - 792 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_dependencies/test_tutorial012_an.py

    
    def test_get_invalid_second_header_items():
        response = client.get(
            "/items/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"}
        )
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "X-Key header invalid"}
    
    
    def test_get_invalid_second_header_users():
        response = client.get(
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  3. docs_src/app_testing/app_b_an/test_main.py

    
    def test_read_nonexistent_item():
        response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 404
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_create_item():
        response = client.post(
            "/items/",
            headers={"X-Token": "coneofsilence"},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  4. docs_src/app_testing/app_b/test_main.py

    
    def test_read_nonexistent_item():
        response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 404
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_create_item():
        response = client.post(
            "/items/",
            headers={"X-Token": "coneofsilence"},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial006_an.py

    
    def test_security_http_basic_non_basic_credentials():
        payload = b64encode(b"johnsecret").decode("ascii")
        auth_header = f"Basic {payload}"
        response = client.get("/users/me", headers={"Authorization": auth_header})
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == "Basic"
        assert response.json() == {"detail": "Invalid authentication credentials"}
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  6. fastapi/security/http.py

                        detail="Not authenticated",
                        headers=unauthorized_headers,
                    )
                else:
                    return None
            invalid_user_credentials_exc = HTTPException(
                status_code=HTTP_401_UNAUTHORIZED,
                detail="Invalid authentication credentials",
                headers=unauthorized_headers,
            )
            try:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_header_params/test_tutorial002_an.py

            ),
            (
                "/items",
                {"strange-header": "Not really underscore"},
                200,
                {"strange_header": None},
            ),
        ],
    )
    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
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4K bytes
    - Viewed (0)
  8. tests/test_security_http_basic_realm_description.py

    
    def test_security_http_basic_non_basic_credentials():
        payload = b64encode(b"johnsecret").decode("ascii")
        auth_header = f"Basic {payload}"
        response = client.get("/users/me", headers={"Authorization": auth_header})
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
        assert response.json() == {"detail": "Invalid authentication credentials"}
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_header_params/test_tutorial002_py310.py

                200,
                {"strange_header": "FastAPI test"},
            ),
            (
                "/items",
                {"strange-header": "Not really underscore"},
                200,
                {"strange_header": None},
            ),
        ],
    )
    def test(path, headers, expected_status, expected_response, client: TestClient):
        response = client.get(path, headers=headers)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_header_params/test_tutorial001_an_py310.py

        ],
    )
    def test(path, headers, expected_status, expected_response, client: TestClient):
        response = client.get(path, headers=headers)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    @needs_py310
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4K bytes
    - Viewed (0)
Back to top