Skip to content
Browse files

bean-ify the :body on debug output if it's not a string

  • Loading branch information...
1 parent 9f87387 commit b2353bb6a6d25cd78e7d69061f58fa084c3fba1b @dakrone dakrone committed Mar 22, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/clj_http/core.clj
View
5 src/clj_http/core.clj
@@ -211,7 +211,10 @@
(when debug
(println "Request:")
(clojure.pprint/pprint
- (assoc req :body (format "... %s bytes ..." (count (:body req)))))
+ (assoc req :body (if (isa? (:body req) String)
+ (format "... %s bytes ..."
+ (count (:body req)))
+ (bean (:body req)))))
(println "HttpRequest:")
(clojure.pprint/pprint (bean http-req)))
(let [http-resp (.execute http-client http-req)

0 comments on commit b2353bb

Please sign in to comment.
Something went wrong with that request. Please try again.