Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 49 for Kuper (0.14 sec)

  1. tests/test_tutorial/test_dependencies/test_tutorial012.py

        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(
            "/users/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"}
        )
    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)
  2. fastapi/exceptions.py

        def __init__(self, errors: Sequence[Any], *, body: Any = None) -> None:
            super().__init__(errors)
            self.body = body
    
    
    class WebSocketRequestValidationError(ValidationException):
        pass
    
    
    class ResponseValidationError(ValidationException):
        def __init__(self, errors: Sequence[Any], *, body: Any = None) -> None:
            super().__init__(errors)
            self.body = body
    
        def __str__(self) -> str:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  3. fastapi/datastructures.py

            To be awaitable, compatible with async, this is run in threadpool.
            """
            return await super().seek(offset)
    
        async def close(self) -> None:
            """
            Close the file.
    
            To be awaitable, compatible with async, this is run in threadpool.
            """
            return await super().close()
    
        @classmethod
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  4. docs_src/custom_request_and_route/tutorial001.py

            if not hasattr(self, "_body"):
                body = await super().body()
                if "gzip" in self.headers.getlist("Content-Encoding"):
                    body = gzip.decompress(body)
                self._body = body
            return self._body
    
    
    class GzipRoute(APIRoute):
        def get_route_handler(self) -> Callable:
            original_route_handler = super().get_route_handler()
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 973 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial012_an.py

    from typing_extensions import Annotated
    
    
    async def verify_token(x_token: Annotated[str, Header()]):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def verify_key(x_key: Annotated[str, Header()]):
        if x_key != "fake-super-secret-key":
            raise HTTPException(status_code=400, detail="X-Key header invalid")
        return x_key
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 756 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial012.py

    from fastapi import Depends, FastAPI, Header, HTTPException
    
    
    async def verify_token(x_token: str = Header()):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def verify_key(x_key: str = Header()):
        if x_key != "fake-super-secret-key":
            raise HTTPException(status_code=400, detail="X-Key header invalid")
        return x_key
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 696 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_dependencies/test_tutorial006.py

            "/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_valid_headers():
        response = client.get(
            "/items/",
            headers={
                "X-Token": "fake-super-secret-token",
                "X-Key": "fake-super-secret-key",
            },
        )
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_dependencies/test_tutorial006_an.py

            "/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_valid_headers():
        response = client.get(
            "/items/",
            headers={
                "X-Token": "fake-super-secret-token",
                "X-Key": "fake-super-secret-key",
            },
        )
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 5K bytes
    - Viewed (0)
  9. fastapi/background.py

            Read more about it in the
            [FastAPI docs for Background Tasks](https://fastapi.tiangolo.com/tutorial/background-tasks/).
            """
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py

            "/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"}
    
    
    @needs_py39
    def test_get_invalid_second_header_users(client: TestClient):
        response = client.get(
            "/users/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"}
        )
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.8K bytes
    - Viewed (0)
Back to top