Manually send POST request to fire callback

I am trying to manually send a POST request to activate a callback by copying the payload from inspecting the application page. Is this possible?

The purpose is I am trying to perform load testing using Locust and I want to click a button in the app. I can send a GET request to the button’s .js but then to POST the chart I want to send a POST to _dash-update-component and I get 500 error.

What is the proper way to do this?

Here’s what my locustfile.py looks like (I removed data for testing purposes)…

from locust import HttpUser, task, between
import time
import json


class QuickstartUser(HttpUser):
    wait_time = between(1, 2.5)

    @task
    def hello_world(self):
        payload = {
                "output":"..fdfdf..",
                "outputs":[
                    {},
                    {}
                ],
                "inputs":[
                    {"id":"run-btn","property":"n_clicks","value":1},
                    {"id":"prod-table","property":"data","value":[
                        {},
                        {}
                    ]},
                    {"id":"table","property":"columns","value":[
                        {},
                        {}
                    ]},
                    {"id":"table","property":"data","value":[
                        {"test": 10}
                    ]},
                    {"id":"table","property":"columns","value":[
                        {"name":"Jul 2021","id":"Jul 2021"},
                        {"name":"Aug 2021","id":"Aug 2021"},
                        {"name":"Sep 2021","id":"Sep 2021"},
                        {"name":"Oct 2021","id":"Oct 2021"},
                        {"name":"Nov 2021","id":"Nov 2021"},
                        {"name":"Dec 2021","id":"Dec 2021"},
                        {"name":"Jan 2022","id":"Jan 2022"},
                        {"name":"Feb 2022","id":"Feb 2022"},
                        {"name":"Mar 2022","id":"Mar 2022"},
                        {"name":"Apr 2022","id":"Apr 2022"},
                        {"name":"May 2022","id":"May 2022"}
                    ]}
                ],
                "changedPropIds":["run-btn.n_clicks"],
                "state":[
                    {"id":"num","property":"value","value":20},
                    {"id":"slider","property":"value","value":[0,20]},
                    {"id":"month-dropdown","property":"value"},
                    {"id":"percent","property":"value","value":100}
                ]
            }
        self.client.get("/_dash-component-suites/dash_renderer/react-dom@16.v1_9_1m1626286569.14.0.min.js")
        time.sleep(1)
        self.client.post(
            "/_dash-update-component",
            data=json.dumps(payload)
        )