Skip to content

Commit 6231a36

Browse files
committedNov 19, 2020
python: fixed incorrect JSON encoding method
1 parent 3d1ed4f commit 6231a36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎otohttp/templates/client.py.plush

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class Client:
2424
"""<%= format_comment_line(method.Comment) %>"""
2525
url = "{}/<%= service.Name %>.<%= method.Name %>".format(self.client.endpoint)
2626
headers = {
27-
'Accept': 'application/json; charset=utf8',
27+
'Accept': 'application/json; charset=utf8',
2828
'Content-Type': 'application/json; charset=utf8',
29-
'X-API-Key': self.client.apiKey,
29+
'X-API-Key': self.client.apiKey,
3030
}
3131
r = requests.post(url, json=<%= method.InputObject.ObjectNameLowerCamel %>, headers=headers)
3232
if r.status_code != 200:
@@ -54,7 +54,7 @@ class <%= object.Name %>:
5454
<% } %>
5555
def json():
5656
""""get a JSON representation of this object"""
57-
return json.puts(self)
57+
return json.dumps(self)
5858

5959
<% } %>
6060

@@ -82,4 +82,4 @@ class FieldError(Error):
8282

8383
def __init__(self, field, message):
8484
self.field = field
85-
self.message = message
85+
self.message = message

0 commit comments

Comments
 (0)
Please sign in to comment.