Skip to content

Commit

Permalink
rm old fns check-success-response and success-content
Browse files Browse the repository at this point in the history
+ make post-request-body-decoded public
  • Loading branch information
tavisrudd committed Jan 13, 2012
1 parent 853911d commit b3b1ee9
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/oauth/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ to approve the Consumer's access to their account."
(throw (new Exception (str "Got non-success code: " code ". "
"Content: " (:body m))))
m)))
(defn- post-request-body-decoded [url & [req]]
(defn post-request-body-decoded [url & [req]]
#_(success-content
(http/post (:request-uri consumer)
:headers {"Authorization" (authorization-header params)}
Expand Down Expand Up @@ -150,17 +150,3 @@ Authorization HTTP header or added as query parameters to the request."
:oauth_signature signature)]
(oauth-post-request-decoded (:access-uri consumer)
params post-params)))

;;; for backwards compat with external code
(defn check-success-response [m]
(let [code (:code m)
reason (:reason m)]
(if (or (< code 200)
(>= code 300))
(throw (new Exception (str "Got non-success code: " code ". "
"Reason: " reason ", "
"Content: " (:content m))))
m)))

(defn success-content [m]
(:content (check-success-response m)))

0 comments on commit b3b1ee9

Please sign in to comment.