Fixed small bug

This commit is contained in:
jeffser
2024-07-03 20:43:35 -06:00
parent 4a11833206
commit 1a6287ba73
2 changed files with 3 additions and 1 deletions

View File

@@ -45,9 +45,11 @@ def simple_delete(connection_url:str, data) -> dict:
def stream_post(connection_url:str, data, callback:callable) -> dict:
try:
response = requests.post(connection_url, headers=get_headers(True), data=data, stream=True)
print(response)
if response.status_code == 200:
for line in response.iter_lines():
if line:
print(line.decode("utf-8"))
callback(json.loads(line.decode("utf-8")))
return {"status": "ok", "status_code": response.status_code}
else: