diff --git a/yandex_connect/base.py b/yandex_connect/base.py index 9b637ca..3d2f4d4 100644 --- a/yandex_connect/base.py +++ b/yandex_connect/base.py @@ -120,11 +120,14 @@ class YandexConnectRequest(object): if not url.endswith('/'): url = '%s/' % url - if data: + if data and isinstance(data, dict): for key in list(data): if data[key] is None or (isinstance(data[key], dict) and not data[key]): del data[key] continue + if 'id' in data and type(data['id']) is not int: + data['id'] = int(data['id']) + method = method.lower() if method not in ['get', 'post', 'patch', 'delete']: raise ValueError('Not right method')