Skip to content

Commit 6bfb467

Browse files
author
Maarten Bremer
committed
Adding User-Agent with version information to the headers
1 parent 685bc0b commit 6bfb467

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
'''The setup and build script for the xilphin-api library.'''
3+
'''The setup and build script for the xolphin-api library.'''
44

55
import os
66

@@ -13,8 +13,8 @@ def read(*paths):
1313
setup(
1414
name='xolphin-api',
1515
version='1.1.0',
16-
author='Roman Ragimoff',
17-
author_email='roma.ragimoff@gmail.com',
16+
author='Xolphin',
17+
author_email='info@xolphin.com',
1818
license='MIT',
1919
url='https://github.com/xolphin/xolphin-api-python',
2020
keywords='xolphin',

xolphin/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818

1919
class Client(object):
2020
BASE_URL = 'https://api.xolphin.com/v1/'
21+
VERSION = '1.1'
2122

2223
def __init__(self, username, password):
2324
self.username = username
2425
self.password = password
2526

2627
self._session = requests.session()
27-
self._session.headers.update({'Accept': 'application/json'})
28+
self._session.headers.update({'Accept': 'application/json', 'User-Agent': 'xolphin-api-python/%s' % Client.VERSION})
2829
self._session.auth = HTTPBasicAuth(username, password)
2930
#self._session.proxies.update({
3031
# 'http': '127.0.0.1:8888',

0 commit comments

Comments
 (0)