Skip to content

Commit 41fdae1

Browse files
committed
Fixed bug with non OAuth signed POST requests
Fixed bug where non signed POST requests did not have POST data.
1 parent 2c79dfe commit 41fdae1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ox3apiclient.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ def _sign_request(self, req):
6767
data = req.data
6868

6969
# Add any (POST) data to the parameters to be signed in the OAuth
70-
# request as well as store 'stringified' copy for the request's body.
70+
# request.
7171
if data:
7272
parameters.update(data)
73-
data = urllib.urlencode(data)
7473

7574
# Create a temporary oauth2 Request object and sign it so we can steal
7675
# the Authorization header.
@@ -112,6 +111,10 @@ def request(self, url, method='GET', headers={}, data=None, sign=False):
112111
if sign:
113112
req = self._sign_request(req)
114113

114+
# Stringify data.
115+
if data:
116+
req.add_data(urllib.urlencode(req.get_data()))
117+
115118
return urllib2.urlopen(req)
116119

117120
def fetch_request_token(self):

0 commit comments

Comments
 (0)