We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent8d8e19d commitd57c7f6Copy full SHA for d57c7f6
zencoder/core.py
@@ -56,12 +56,14 @@ def content_length(self, body):
56
"""
57
returnstr(len(body))ifbodyelse"0"
58
59
+@property
60
+defheaders(self):
61
ifself.as_xml:
-self.headers= {'Content-Type':'application/xml',
-'Accepts':'application/xml'}
62
+return {'Content-Type':'application/xml',
63
+'Accepts':'application/xml'}
64
else:
-self.headers= {'Content-Type':'application/json',
-'Accepts':'application/json'}
65
+return {'Content-Type':'application/json',
66
+'Accepts':'application/json'}
67
68
defencode(self,data):
69
@@ -117,6 +119,7 @@ def post(self, url, body=None):
117
119
118
120
Executes an HTTP POST request for the given URL
121
122
+headers=self.headers
123
headers['Content-Length']=self.content_length(body)
124
response,content=self.http.request(url,method="POST",
125
body=body,