Skip to content

Commit d9584e0

Browse files
committed
Refactor PruneSignal to encapsulate data in a dictionary before sending HTTP request
- Updated the PruneSignal class to wrap the data in a dictionary when making the POST request, improving the structure of the request payload.
1 parent 394a6cf commit d9584e0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

python-sdk/exospherehost/signals.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ async def send(self, endpoint: str, key: str):
2727
Raises:
2828
Exception: If the HTTP request fails (status code != 200).
2929
"""
30+
body = {
31+
"data": self.data
32+
}
3033
async with ClientSession() as session:
31-
async with session.post(endpoint, json=self.data, headers={"x-api-key": key}) as response:
34+
async with session.post(endpoint, json=body, headers={"x-api-key": key}) as response:
3235
if response.status != 200:
3336
raise Exception(f"Failed to send prune signal to {endpoint}")
3437

0 commit comments

Comments
 (0)