We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd14bdc commit 61024feCopy full SHA for 61024fe
src/clojure/http/client.clj
@@ -20,6 +20,11 @@ representation of text."
20
[body]
21
(str-join "&" (map #(str-join "=" (map url-encode %)) body)))
22
23
+(defn- encode-body [body]
24
+ (if (string? body)
25
+ body
26
+ (encode-body-map body)))
27
+
28
(defn url
29
"If u is an instance of java.net.URL then returns it without
30
modification, otherwise tries to instantiate a java.net.URL with
@@ -94,7 +99,7 @@ by a server."
94
99
"application/x-www-form-urlencoded")
95
100
(.connect connection)
96
101
(with-open [out (writer (.getOutputStream connection))]
97
- (.write out "{ hello: \"world\" }")
102
+ (.write out (encode-body body))
98
103
(.flush out)))
104
(.connect connection))
105
0 commit comments