Skip to content

Commit 6ac6028

Browse files
committed
Add clojure clj-http tests
1 parent e7e408c commit 6ac6028

File tree

15 files changed

+74
-0
lines changed

15 files changed

+74
-0
lines changed

test/fixtures/available-targets.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,20 @@
221221
}
222222
]
223223
},
224+
{
225+
"key": "clojure",
226+
"title": "Clojure",
227+
"extname": ".clj",
228+
"default": "clj_http",
229+
"clients": [
230+
{
231+
"key": "clj_http",
232+
"title": "clj-http",
233+
"link": "https://github.com/dakrone/clj-http",
234+
"description": "An idiomatic clojure http client wrapping the apache client."
235+
}
236+
]
237+
},
224238
{
225239
"key": "c",
226240
"title": "C",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/post "http://mockbin.com/har" {:form-params {:foo "bar"
4+
:hello "world"}})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/post "http://mockbin.com/har" {:content-type :json
4+
:form-params {:number 1
5+
:string "f\"oo"
6+
:arr [1 2 3]
7+
:nested {:a "b"}
8+
:arr_mix [1 "a" {:arr_mix_nested {}}]
9+
:boolean false}})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/post "http://mockbin.com/har" {:headers {:cookie "foo=bar; bar=baz"}})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Method not supported
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/post "http://mockbin.com/har" {:headers {:cookie "foo=bar; bar=baz"}
4+
:query-params {:foo ["bar" "baz"]
5+
:baz "abc"
6+
:key "value"}
7+
:form-params {:foo "bar"}
8+
:accept :json})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/get "http://mockbin.com/har" {:headers {:x-foo "Bar"}
4+
:accept :json})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/get "https://mockbin.com/har")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/post "http://mockbin.com/har" {:multipart [{:name "foo"
4+
:content "Hello World"}]})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(require '[clj-http.client :as client])
2+
3+
(client/post "http://mockbin.com/har" {:multipart [{:name "foo"
4+
:content (clojure.java.io/file "test/fixtures/files/hello.txt")}]})

0 commit comments

Comments
 (0)