error 406 not acceptable for login api
i have an issue and want help i try to use sonicwall api version 6.5 and when i try to use basic auth api it give me ( error 406 not acceptable) but i am sure i make the request with acceptable header and this my code :
def login(tenant_ip,port,cred):
url = "https://{0}:{1}/api/sonicos/auth".format(tenant_ip,port)
headers = { 'Authorization': 'Basic ' + cred, 'Accept': 'application/json' }
try:
response = requests.request("POST", url, headers=headers, verify=False)
response.raise_for_status()
return { 'success': True, 'data': response.json() }
except requests.exceptions.RequestException as e:
txt_res = None
if hasattr(e,'response') and e.response is not None:
txt_res = e.response.text
return { 'success': False, 'error': str(e), 'response_text': txt_res }