Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 383 for pead (0.32 sec)

  1. docs_src/custom_response/tutorial004.py

    def generate_html_response():
        html_content = """
        <html>
            <head>
                <title>Some HTML in here</title>
            </head>
            <body>
                <h1>Look ma! HTML!</h1>
            </body>
        </html>
        """
        return HTMLResponse(content=html_content, status_code=200)
    
    
    @app.get("/items/", response_class=HTMLResponse)
    async def read_items():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 491 bytes
    - Viewed (0)
  2. tests/test_operations_signatures.py

    import inspect
    
    from fastapi import APIRouter, FastAPI
    
    method_names = ["get", "put", "post", "delete", "options", "head", "patch", "trace"]
    
    
    def test_signatures_consistency():
        base_sig = inspect.signature(APIRouter.get)
        for method_name in method_names:
            router_method = getattr(APIRouter, method_name)
            app_method = getattr(FastAPI, method_name)
            router_sig = inspect.signature(router_method)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon May 27 12:08:13 GMT 2019
    - 934 bytes
    - Viewed (0)
  3. .github/actions/people/app/main.py

        people_path = Path("./docs/en/data/people.yml")
        github_sponsors_path = Path("./docs/en/data/github_sponsors.yml")
        people_old_content = people_path.read_text(encoding="utf-8")
        github_sponsors_old_content = github_sponsors_path.read_text(encoding="utf-8")
        new_people_content = yaml.dump(
            people, sort_keys=False, width=200, allow_unicode=True
        )
        new_github_sponsors_content = yaml.dump(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  4. docs_src/websockets/tutorial002_py310.py

        FastAPI,
        Query,
        WebSocket,
        WebSocketException,
        status,
    )
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    html = """
    <!DOCTYPE html>
    <html>
        <head>
            <title>Chat</title>
        </head>
        <body>
            <h1>WebSocket Chat</h1>
            <form action="" onsubmit="sendMessage(event)">
                <label>Item ID: <input type="text" id="itemId" autocomplete="off" value="foo"/></label>
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2.7K bytes
    - Viewed (0)
  5. tests/test_response_by_alias.py

    
    @app.get("/dict", response_model=Model, response_model_by_alias=False)
    def read_dict():
        return {"alias": "Foo"}
    
    
    @app.get("/model", response_model=Model, response_model_by_alias=False)
    def read_model():
        return Model(alias="Foo")
    
    
    @app.get("/list", response_model=List[Model], response_model_by_alias=False)
    def read_list():
        return [{"alias": "Foo"}, {"alias": "Bar"}]
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py

                                "content": {"application/json": {"schema": {}}},
                            }
                        },
                        "tags": ["items"],
                        "summary": "Read Items",
                        "operationId": "read_items_items__get",
                    }
                },
                "/users/": {
                    "get": {
                        "responses": {
                            "200": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  7. fastapi/security/oauth2.py

                    For example, a single string with:
    
                    ```python
                    "items:read items:write users:read profile openid"
                    ````
    
                    would represent the scopes:
    
                    * `items:read`
                    * `items:write`
                    * `users:read`
                    * `profile`
                    * `openid`
                    """
                ),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  8. tests/test_tutorial/test_testing/test_tutorial001.py

    from docs_src.app_testing.tutorial001 import client, test_read_main
    
    
    def test_main():
        test_read_main()
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 821 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_security/test_tutorial005_an.py

    
    def test_read_items():
        access_token = get_access_token(scope="me items")
        response = client.get(
            "/users/me/items/", headers={"Authorization": f"Bearer {access_token}"}
        )
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo", "owner": "johndoe"}]
    
    
    def test_read_system_status():
        access_token = get_access_token()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_extra_data_types/test_tutorial001.py

                                        }
                                    }
                                },
                            },
                        },
                        "summary": "Read Items",
                        "operationId": "read_items_items__item_id__put",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 6.8K bytes
    - Viewed (0)
Back to top