File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 22import httplib2
33from urllib import urlencode
44
5+ # Library version. Should probably be rewritten to match the version in setup.py
6+ lib_version = 0.5 ;
7+
58# Note: I've seen this pattern for dealing with json in different versions of
69# python in a lot of modules -- if there's a better way, I'd love to use it.
710try :
@@ -59,11 +62,13 @@ def headers(self):
5962 headers.
6063 """
6164 if self .as_xml :
62- return {'Content-Type' : 'application/xml' ,
63- 'Accepts' : 'application/xml' }
64- else :
65- return {'Content-Type' : 'application/json' ,
66- 'Accepts' : 'application/json' }
65+ content_type = 'xml'
66+ else :
67+ content_type = 'json'
68+
69+ return {'Content-Type' : 'application/' + content_type ,
70+ 'Accepts' : 'application/' + content_type ,
71+ 'User-Agent' : 'Zencoder-Py v' + str (lib_version )}
6772
6873 def encode (self , data ):
6974 """
You can’t perform that action at this time.
0 commit comments