Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 1,632 for Post (0.24 sec)

  1. tests/test_additional_properties_bool.py

        pass
    
    
    app = FastAPI()
    
    
    @app.post("/")
    async def post(
        foo: Union[Foo, None] = None,
    ):
        return foo
    
    
    client = TestClient(app)
    
    
    def test_call_invalid():
        response = client.post("/", json={"foo": {"bar": "baz"}})
        assert response.status_code == 422
    
    
    def test_call_valid():
        response = client.post("/", json={})
        assert response.status_code == 200
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py

        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial002_py39.py

            {
                "loc": ["body", "files"],
                "msg": "field required",
                "type": "value_error.missing",
            }
        ]
    }
    
    
    @needs_py39
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9K bytes
    - Viewed (0)
  4. apache-maven/src/assembly/shared/run.cmd

    if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
    @REM check for post script, once with legacy .bat ending and once with .cmd ending
    if exist "%USERPROFILE%\mavenrc_post.bat" echo Warning: The mavenrc_post.bat script is deprecated and will be removed in a future version. >&2
    if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
    Batch File
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Sat Mar 05 22:52:54 GMT 2022
    - 1.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py

        return client
    
    
    @needs_py39
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo"}
    
    
    @needs_py39
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  6. 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 May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial003_an.py

    client = TestClient(app)
    
    
    def test_post_files(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
        path2.write_bytes(b"<file content2>")
    
        client = TestClient(app)
        with path.open("rb") as file, path2.open("rb") as file2:
            response = client.post(
                "/files/",
                files=(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  8. tests/test_openapi_separate_input_output_schemas.py

    
    def get_app_client(separate_input_output_schemas: bool = True) -> TestClient:
        app = FastAPI(separate_input_output_schemas=separate_input_output_schemas)
    
        @app.post("/items/")
        def create_item(item: Item):
            return item
    
        @app.post("/items-list/")
        def create_item_list(item: List[Item]):
            return item
    
        @app.get("/items/")
        def read_items() -> List[Item]:
            return [
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 18.4K bytes
    - Viewed (2)
  9. tests/test_schema_extra_examples.py

        client = TestClient(app)
        response = client.post("/schema_extra/", json={"data": "Foo"})
        assert response.status_code == 200, response.text
        response = client.post("/example/", json={"data": "Foo"})
        assert response.status_code == 200, response.text
        response = client.post("/examples/", json={"data": "Foo"})
        assert response.status_code == 200, response.text
        response = client.post("/example_examples/", json={"data": "Foo"})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  10. tests/postgres_test.go

    	}
    
    	DB.Migrator().DropTable(&Post{}, &Category{}, "post_categories")
    	DB.AutoMigrate(&Post{}, &Category{})
    
    	post := Post{
    		Title: "Hello World",
    		Categories: []*Category{
    			{Title: "Coding"},
    			{Title: "Golang"},
    		},
    	}
    
    	if err := DB.Create(&post).Error; err != nil {
    		t.Errorf("Failed, got error: %v", err)
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
Back to top