Skip to content

Commit a5a842d

Browse files
committed
Send data as JSON
1 parent d84ad77 commit a5a842d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

detectlanguage/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def get(self, path, payload = {}):
1111
return self.handle_response(r)
1212

1313
def post(self, path, payload):
14-
r = requests.post(self.url(path), data=self.data(payload), headers = self.headers())
14+
r = requests.post(self.url(path), json=self.data(payload), headers = self.headers())
1515
return self.handle_response(r)
1616

1717
def handle_response(self, r):
@@ -21,7 +21,7 @@ def handle_response(self, r):
2121
raise DetectLanguageError(json['error']['message'])
2222

2323
r.raise_for_status()
24-
24+
2525
return json
2626

2727
def url(self, path):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
url = 'https://github.com/detectlanguage/detectlanguage-python',
1414
download_url = 'https://github.com/detectlanguage/detectlanguage-python',
1515
keywords = ['language', 'identification', 'detection', 'api', 'client'],
16-
install_requires= ['requests>=1.2.0'],
16+
install_requires= ['requests>=2.4.2'],
1717
classifiers = [],
1818
license = 'MIT',
1919
)

0 commit comments

Comments
 (0)