Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for geturl (0.2 sec)

  1. docs_src/handling_errors/tutorial003.py

    async def unicorn_exception_handler(request: Request, exc: UnicornException):
        return JSONResponse(
            status_code=418,
            content={"message": f"Oops! {exc.name} did something. There goes a rainbow..."},
        )
    
    
    @app.get("/unicorns/{name}")
    async def read_unicorn(name: str):
        if name == "yolo":
            raise UnicornException(name=name)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 626 bytes
    - Viewed (0)
  2. docs_src/additional_responses/tutorial003.py

                    }
                },
            },
        },
    )
    async def read_item(item_id: str):
        if item_id == "foo":
            return {"id": "foo", "value": "there goes my hero"}
        else:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 837 bytes
    - Viewed (0)
  3. docs_src/body_nested_models/tutorial003.py

        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
        results = {"item_id": item_id, "item": item}
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 414 bytes
    - Viewed (0)
  4. docs_src/request_files/tutorial003.py

    @app.post("/files/")
    async def create_files(
        files: List[bytes] = File(description="Multiple files as bytes"),
    ):
        return {"file_sizes": [len(file) for file in files]}
    
    
    @app.post("/uploadfiles/")
    async def create_upload_files(
        files: List[UploadFile] = File(description="Multiple files as UploadFile"),
    ):
        return {"filenames": [file.filename for file in files]}
    
    
    @app.get("/")
    async def main():
        content = """
    <body>
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 913 bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial003.py

    def get_name_with_age(name: str, age: int):
        name_with_age = name + " is this old: " + age
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 119 bytes
    - Viewed (0)
  6. docs_src/advanced_middleware/tutorial003.py

    from fastapi import FastAPI
    from fastapi.middleware.gzip import GZipMiddleware
    
    app = FastAPI()
    
    app.add_middleware(GZipMiddleware, minimum_size=1000)
    
    
    @app.get("/")
    async def main():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 213 bytes
    - Viewed (0)
  7. docs_src/header_params/tutorial003.py

    from typing import List, Union
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(x_token: Union[List[str], None] = Header(default=None)):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 224 bytes
    - Viewed (0)
  8. docs_src/path_params_numeric_validations/tutorial003.py

    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 268 bytes
    - Viewed (0)
  9. docs_src/custom_response/tutorial003.py

        html_content = """
        <html>
            <head>
                <title>Some HTML in here</title>
            </head>
            <body>
                <h1>Look ma! HTML!</h1>
            </body>
        </html>
        """
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 394 bytes
    - Viewed (0)
  10. docs_src/behind_a_proxy/tutorial003.py

            {"url": "https://prod.example.com", "description": "Production environment"},
        ],
        root_path="/api/v1",
    )
    
    
    @app.get("/app")
    def read_main(request: Request):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 10 17:28:18 GMT 2020
    - 405 bytes
    - Viewed (0)
Back to top