Browse Source

Default to application/x-www-form-urlencoded in oauth_http:post.

Tim Fletcher 16 years ago
parent
commit
102698d147
2 changed files with 5 additions and 5 deletions
  1. 2 4
      src/oauth.erl
  2. 3 1
      src/oauth_http.erl

+ 2 - 4
src/oauth.erl

@@ -28,7 +28,5 @@ post(URL, Consumer, TokenPair) ->
   post(URL, Consumer, TokenPair, []).
   post(URL, Consumer, TokenPair, []).
 
 
 post(URL, Consumer, TokenPair, Params) ->
 post(URL, Consumer, TokenPair, Params) ->
-  oauth_http:post(URL, {
-    "application/x-www-form-urlencoded",
-    oauth_request:params_string("POST", URL, Params, Consumer, TokenPair)
-  }).
+  Data = oauth_request:params_string("POST", URL, Params, Consumer, TokenPair),
+  oauth_http:post(URL, Data).

+ 3 - 1
src/oauth_http.erl

@@ -8,4 +8,6 @@ get(URL) ->
   http:request(URL).
   http:request(URL).
 
 
 post(URL, {MimeType, Data}) ->
 post(URL, {MimeType, Data}) ->
-  http:request(post, {URL, [], MimeType, Data}, [], []).
+  http:request(post, {URL, [], MimeType, Data}, [], []);
+post(URL, Data) ->
+  post(URL, {"application/x-www-form-urlencoded", Data}).