(feat) API custom callbacks

This commit is contained in:
ishaan-jaff 2024-02-15 16:23:05 -08:00
parent 47b8715d25
commit aa333161a8
2 changed files with 6 additions and 3 deletions

View file

@ -106,15 +106,14 @@ class GenericAPILogger:
import json
payload = json.dumps(payload)
data = {
"data": payload,
}
data = json.dumps(data)
print_verbose(f"\nGeneric Logger - Logging payload = {data}")
# make request to endpoint with payload
response = requests.post(self.endpoint, data=data, headers=self.headers)
response = requests.post(self.endpoint, json=data, headers=self.headers)
response_status = response.status_code
response_text = response.text