Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 190 for rakish (0.31 sec)

  1. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

        Note over client,tasks: Can raise exception for dependency, handled after response is sent
        Note over client,operation: Can raise HTTPException and can change the response
        client ->> dep: Start request
        Note over dep: Run code up to yield
        opt raise
            dep -->> handler: Raise HTTPException
            handler -->> client: HTTP error response
            dep -->> dep: Raise other exception
        end
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  2. tests/test_serialize_response.py

        ]
    
    
    client = TestClient(app)
    
    
    def test_valid():
        response = client.get("/items/valid")
        response.raise_for_status()
        assert response.json() == {"name": "valid", "price": 1.0, "owner_ids": None}
    
    
    def test_coerce():
        response = client.get("/items/coerce")
        response.raise_for_status()
        assert response.json() == {"name": "coerce", "price": 1.0, "owner_ids": None}
    
    
    def test_validlist():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Aug 03 12:29:07 GMT 2020
    - 1.4K bytes
    - Viewed (0)
  3. fastapi/security/api_key.py

        async def __call__(self, request: Request) -> Optional[str]:
            api_key = request.query_params.get(self.model.name)
            if not api_key:
                if self.auto_error:
                    raise HTTPException(
                        status_code=HTTP_403_FORBIDDEN, detail="Not authenticated"
                    )
                else:
                    return None
            return api_key
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 23 22:29:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  4. fastapi/security/http.py

            try:
                data = b64decode(param).decode("ascii")
            except (ValueError, UnicodeDecodeError, binascii.Error):
                raise invalid_user_credentials_exc  # noqa: B904
            username, separator, password = data.partition(":")
            if not separator:
                raise invalid_user_credentials_exc
            return HTTPBasicCredentials(username=username, password=password)
    
    
    class HTTPBearer(HTTPBase):
        """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  5. tests/transaction_test.go

    	user := User{Name: "transaction"}
    	if err := tx.Save(&user).Error; err != nil {
    		t.Fatalf("No error should raise")
    	}
    
    	if err := tx.Commit().Error; err != nil {
    		t.Fatalf("Commit should not raise error")
    	}
    
    	if err := tx.Rollback().Error; err == nil {
    		t.Fatalf("Rollback after commit should raise error")
    	}
    }
    
    func TestTransactionWithSavePoint(t *testing.T) {
    	tx := DB.Begin()
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  6. docs_src/bigger_applications/app/dependencies.py

    from fastapi import Header, HTTPException
    
    
    async def get_token_header(x_token: str = Header()):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def get_query_token(token: str):
        if token != "jessica":
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 369 bytes
    - Viewed (0)
  7. docs/sts/client_grants/sts_element.py

            :return: Returns an STSElement.
            """
            try:
                return cls(root_name, cElementTree.fromstring(data))
            except _ETREE_EXCEPTIONS as error:
                raise InvalidXMLError(
                    '"{}" XML is not parsable. Message: {}'.format(
                        root_name, error.message
                    )
                )
    
        def findall(self, name):
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  8. fastapi/exceptions.py

    from starlette.exceptions import WebSocketException as StarletteWebSocketException
    from typing_extensions import Annotated, Doc
    
    
    class HTTPException(StarletteHTTPException):
        """
        An HTTP exception you can raise in your own code to show errors to the client.
    
        This is for client errors, invalid authentication, invalid data, etc. Not for server
        errors in your code.
    
        Read more about it in the
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  9. docs_src/bigger_applications/app_an_py39/dependencies.py

    
    async def get_token_header(x_token: Annotated[str, Header()]):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def get_query_token(token: str):
        if token != "jessica":
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 409 bytes
    - Viewed (0)
  10. docs_src/sql_databases/sql_app_py39/alt_main.py

    
    @app.post("/users/", response_model=schemas.User)
    def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
        db_user = crud.get_user_by_email(db, email=user.email)
        if db_user:
            raise HTTPException(status_code=400, detail="Email already registered")
        return crud.create_user(db=db, user=user)
    
    
    @app.get("/users/", response_model=list[schemas.User])
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.9K bytes
    - Viewed (0)
Back to top