fix: исправить API call (json вместо data) и добавить _sd_ticket_create_error
This commit is contained in:
@@ -178,7 +178,7 @@ async def create_ticket_in_sd(requester_email: str, subject: str, description: s
|
||||
if template_id:
|
||||
req_payload["request"]["request_template"] = {"id": template_id}
|
||||
async with httpx.AsyncClient(verify=False) as client:
|
||||
return await client.post(endpoint, headers=headers, data={"input_data": json.dumps(req_payload)}, timeout=15.0)
|
||||
return await client.post(endpoint, headers=headers, json={"input_data": req_payload}, timeout=15.0)
|
||||
resp = await _send_req(requester_email, city)
|
||||
data = resp.json() if resp.status_code in [200, 201] else {}
|
||||
if data.get("response_status", {}).get("status_code") != 2000:
|
||||
|
||||
Reference in New Issue
Block a user