Permalink
Browse files

fix oauth post issues

  • Loading branch information...
zagraves committed Sep 2, 2010
1 parent 224f0ec commit ad3a8824f41bfddb9fc8857559cbfa6212bc73e3
Showing with 6 additions and 5 deletions.
  1. +6 −5 oauth/oauth.utils.js
View
@@ -35,12 +35,13 @@ function getRequest(args)
function postRequest(args)
{
- var data = oAuthBuildContent(args.parameters);
var auth = (args.accessor) ? oAuthSignRequest(args) : null;
-
+ var data = oAuthBuildContent(auth.message.parameters);
+
var rsp = null;
try {
- if(auth) request.header('Authorization', auth.header);
+ //if(auth) request.header('Authorization', auth.header);
+ request.header('Content-Type', 'application/x-www-form-urlencoded');
rsp = request.post( data ).response;
} catch(err) {
rsp = {'result':'failure', 'error': err};
@@ -106,7 +107,7 @@ function oAuthSignRequest(args)
if(accessor.token) {
OAuth.setParameter(message, "oauth_token", accessor.token);
}
-
+
OAuth.SignatureMethod.sign(message, accessor);
var realm = accessor.realm || '';
@@ -118,4 +119,4 @@ function oAuthSignRequest(args)
}
return auth;
-}
+}

0 comments on commit ad3a882

Please sign in to comment.