Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 997 for Post (0.23 sec)

  1. tests/test_read_with_orm_mode.py

        app = FastAPI()
    
        @app.post("/people/", response_model=PersonRead)
        def create_person(person: PersonCreate) -> Any:
            db_person = Person.model_validate(person)
            return db_person
    
        client = TestClient(app)
    
        person_data = {"name": "Dive", "lastname": "Wilson"}
        response = client.post("/people/", json=person_data)
        data = response.json()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  2. docs_src/openapi_callbacks/tutorial001.py

    class InvoiceEventReceived(BaseModel):
        ok: bool
    
    
    invoices_callback_router = APIRouter()
    
    
    @invoices_callback_router.post(
        "{$callback_url}/invoices/{$request.body.id}", response_model=InvoiceEventReceived
    )
    def invoice_notification(body: InvoiceEvent):
        pass
    
    
    @app.post("/invoices/", callbacks=invoices_callback_router.routes)
    def create_invoice(invoice: Invoice, callback_url: Union[HttpUrl, None] = None):
        """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  3. docs_src/request_files/tutorial002_an.py

    from fastapi.responses import HTMLResponse
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_files(files: Annotated[List[bytes], File()]):
        return {"file_sizes": [len(file) for file in files]}
    
    
    @app.post("/uploadfiles/")
    async def create_upload_files(files: List[UploadFile]):
        return {"filenames": [file.filename for file in files]}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 861 bytes
    - Viewed (0)
  4. docs_src/request_files/tutorial003.py

    from fastapi import FastAPI, File, UploadFile
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    @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"),
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 913 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py310.py

        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_query_params_str_validations(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 42})
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Foo",
            "price": 42,
            "description": None,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 8.9K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py39.py

        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_query_params_str_validations(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 42})
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Foo",
            "price": 42,
            "description": None,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 8.9K bytes
    - Viewed (0)
  7. tests/test_union_body.py

        price: int
    
    
    @app.post("/items/")
    def save_union_body(item: Union[OtherItem, Item]):
        return {"item": item}
    
    
    client = TestClient(app)
    
    
    def test_post_other_item():
        response = client.post("/items/", json={"price": 100})
        assert response.status_code == 200, response.text
        assert response.json() == {"item": {"price": 100}}
    
    
    def test_post_item():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.6K bytes
    - Viewed (0)
  8. docs_src/request_files/tutorial001_02_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Annotated[Union[bytes, None], File()] = None):
        if not file:
            return {"message": "No file sent"}
        else:
            return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: Union[UploadFile, None] = None):
        if not file:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 524 bytes
    - Viewed (0)
  9. api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/LifecyclePhase.java

        INTEGRATION_TEST("integration-test"),
        POST_INTEGRATION_TEST("post-integration-test"),
        VERIFY("verify"),
        INSTALL("install"),
        DEPLOY("deploy"),
    
        PRE_CLEAN("pre-clean"),
        CLEAN("clean"),
        POST_CLEAN("post-clean"),
    
        PRE_SITE("pre-site"),
        SITE("site"),
        POST_SITE("post-site"),
        SITE_DEPLOY("site-deploy"),
    
        NONE("");
    
    Java
    - Registered: Sun Apr 07 03:35:11 GMT 2024
    - Last Modified: Thu Mar 23 05:29:39 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/fess/app/web/api/admin/dict/protwords/ApiAdminDictProtwordsAction.java

            return asJson(
                    new ApiResult.ApiUpdateResponse().id(String.valueOf(entity.getId())).created(true).status(ApiResult.Status.OK).result());
        }
    
        // POST /api/admin/dict/protwords/setting/{dictId}
        @Execute
        public JsonResponse<ApiResult> post$setting(final String dictId, final EditBody body) {
            body.dictId = dictId;
            validateApi(body, messages -> {});
            body.crudMode = CrudMode.EDIT;
    Java
    - Registered: Mon Apr 29 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 7.2K bytes
    - Viewed (0)
Back to top