Search Options

Results per page
Sort
Preferred Languages
Advance

Results 691 - 700 of 1,977 for Fastapi (0.1 sec)

  1. docs_src/body_multiple_params/tutorial004_py310.py

    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    class User(BaseModel):
        username: str
        full_name: str | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item,
        user: User,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Mar 10 18:49:18 UTC 2023
    - 603 bytes
    - Viewed (0)
  2. docs_src/dependencies/tutorial004.py

    from typing import Union
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
    
    
    class CommonQueryParams:
        def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100):
            self.q = q
            self.skip = skip
            self.limit = limit
    
    
    @app.get("/items/")
    async def read_items(commons: CommonQueryParams = Depends()):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 639 bytes
    - Viewed (0)
  3. docs_src/response_model/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: float = 10.5
        tags: list[str] = []
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The bartenders", "price": 62, "tax": 20.2},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 627 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008c.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney ๐Ÿ˜ฑ")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
            raise InternalError(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 660 bytes
    - Viewed (0)
  5. docs_src/extra_data_types/tutorial001_an.py

    from datetime import datetime, time, timedelta
    from typing import Union
    from uuid import UUID
    
    from fastapi import Body, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def read_items(
        item_id: UUID,
        start_datetime: Annotated[datetime, Body()],
        end_datetime: Annotated[datetime, Body()],
        process_after: Annotated[timedelta, Body()],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Apr 19 00:11:40 UTC 2024
    - 830 bytes
    - Viewed (0)
  6. tests/test_security_http_basic_optional.py

    from base64 import b64encode
    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBasic(auto_error=False)
    
    
    @app.get("/users/me")
    def read_current_user(credentials: Optional[HTTPBasicCredentials] = Security(security)):
        if credentials is None:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  7. tests/test_forms_single_model.py

    from typing import List, Optional
    
    from dirty_equals import IsDict
    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class FormModel(BaseModel):
        username: str
        lastname: str
        age: Optional[int] = None
        tags: List[str] = ["foo", "bar"]
        alias_with: str = Field(alias="with", default="nothing")
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 13 09:51:00 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  8. docs/em/docs/advanced/path-operation-advanced-configuration.md

    & ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ‘‰ ๐Ÿšฅ ๐Ÿ’ฝ ๐Ÿ†Ž ๐Ÿ“จ ๐Ÿšซ ๐ŸŽป.
    
    ๐Ÿ–ผ, ๐Ÿ‘‰ ๐Ÿˆธ ๐Ÿ‘ฅ ๐Ÿšซ โš™๏ธ FastAPI ๐Ÿ› ๏ธ ๐Ÿ› ๏ธ โš— ๐ŸŽป ๐Ÿ”— โšช๏ธโžก๏ธ Pydantic ๐Ÿท ๐Ÿšซ ๐Ÿง ๐Ÿ”ฌ ๐ŸŽป. ๐Ÿ‘, ๐Ÿ‘ฅ ๐Ÿ“ฃ ๐Ÿ“จ ๐ŸŽš ๐Ÿ†Ž ๐Ÿ“, ๐Ÿšซ ๐ŸŽป:
    
    ```Python hl_lines="17-22  24"
    {!../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
    ```
    
    ๐Ÿ‘, ๐Ÿ‘ ๐Ÿ‘ฅ ๐Ÿšซ โš™๏ธ ๐Ÿ”ข ๐Ÿ› ๏ธ ๐Ÿ› ๏ธ, ๐Ÿ‘ฅ โš™๏ธ Pydantic ๐Ÿท โŽ ๐Ÿ— ๐ŸŽป ๐Ÿ”— ๐Ÿ’ฝ ๐Ÿ‘ˆ ๐Ÿ‘ฅ ๐Ÿ’š ๐Ÿ“จ ๐Ÿ“.
    
    โคด๏ธ ๐Ÿ‘ฅ โš™๏ธ ๐Ÿ“จ ๐Ÿ”—, & โš— ๐Ÿ’ช `bytes`. ๐Ÿ‘‰ โ›“ ๐Ÿ‘ˆ FastAPI ๐Ÿ† ๐Ÿšซ ๐Ÿ”„ ๐ŸŽป ๐Ÿ“จ ๐Ÿš€ ๐ŸŽป.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  9. .github/ISSUE_TEMPLATE/privileged.yml

    body:
      - type: markdown
        attributes:
          value: |
            Thanks for your interest in FastAPI! ๐Ÿš€
    
            If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/fastapi/fastapi/discussions/categories/questions) instead.
      - type: checkboxes
        id: privileged
        attributes:
          label: Privileged issue
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Jul 29 23:35:07 UTC 2024
    - 888 bytes
    - Viewed (0)
  10. docs_src/body_nested_models/tutorial007.py

    from typing import List, Set, Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel, HttpUrl
    
    app = FastAPI()
    
    
    class Image(BaseModel):
        url: HttpUrl
        name: str
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
        images: Union[List[Image], None] = None
    
    
    class Offer(BaseModel):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 581 bytes
    - Viewed (0)
Back to top