Problem result of request is 401

I am create request

python def get_position(device_id, date_to=datetime.now().isoformat(), date_from=None): date_from = date_from or datetime(2018, 1, 7, 12, 7, 22, 350071).isoformat() param = {'deviceId': device_id, 'from': date_from, 'to': date_to, 'id': 1} logpass = (get_config('Traccar', 'Email'), get_config('Traccar', 'Password')) result = requests.get(get_config('Traccar', 'Host') + '/positions', auth=logpass, params=param, headers=HEADERS) if result.status_code is 200: return result

This code return to me

HTTP 401 Unauthorized - WebApplicationException (SecurityRequestFilter:108 < ...).

Email and password is valid.
Where is my mistake?

Anton Tananaev6 years ago

It means that authentication has failed.

Oh, thanks,you really help me.