Skip to content

Commit 2f8aa9c

Browse files
rowedonaldeFederico Delgado
authored andcommitted
Added Content-Type header for v2
1 parent 09af356 commit 2f8aa9c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ox3apiclient/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ def request(self, url, method='GET', headers={}, data=None, sign=False):
158158
if method == 'POST' and not data:
159159
data = ''
160160

161+
# If it's a POST or PUT request for v2, set the header
162+
# to handle JSON:
163+
if method in ('POST', 'PUT') and self.api_path == API_PATH_V2:
164+
headers['Content-Type'] = 'application/json'
165+
161166
req = urllib2.Request(url, headers=headers, data=data)
162167

163168
# We need to set the request's get_method function to return a HTTP

0 commit comments

Comments
 (0)