Skip to content

Commit 0d9fdbc

Browse files
author
Alex Schworer
committed
Remove encode method and use json.dumps directly.
1 parent 397fcf4 commit 0d9fdbc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

zencoder/core.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ def headers(self):
6767

6868
return headers
6969

70-
def encode(self, data):
71-
"""
72-
Encodes data as JSON (by calling `json.dumps`), so that it can be
73-
passed onto the Zencoder API.
74-
"""
75-
return json.dumps(data)
76-
7770
def delete(self, url, params=None):
7871
"""
7972
Executes an HTTP DELETE request for the given URL
@@ -194,7 +187,7 @@ def create(self, email, tos=1, options=None):
194187
if options:
195188
data.update(options)
196189

197-
return self.post(self.base_url, body=self.encode(data))
190+
return self.post(self.base_url, body=json.dumps(data))
198191

199192
def details(self):
200193
"""
@@ -262,7 +255,7 @@ def create(self, input, outputs=None, options=None):
262255
if options:
263256
data.update(options)
264257

265-
return self.post(self.base_url, body=self.encode(data))
258+
return self.post(self.base_url, body=json.dumps(data))
266259

267260
def list(self, page=1, per_page=50):
268261
"""

0 commit comments

Comments
 (0)