22 lines
665 B
Python
22 lines
665 B
Python
import requests
|
|
import json
|
|
|
|
def test_callback():
|
|
try:
|
|
url = 'http://127.0.0.1:8051/_dash-update-component'
|
|
data = {
|
|
"output": "current-balance.children",
|
|
"inputs": [{"id": "ultra-fast-interval", "property": "n_intervals", "value": 1}],
|
|
"changedPropIds": ["ultra-fast-interval.n_intervals"],
|
|
"state": []
|
|
}
|
|
|
|
response = requests.post(url, json=data, timeout=10)
|
|
print(f"Status: {response.status_code}")
|
|
print(f"Response: {response.text[:1000]}")
|
|
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
test_callback() |