@@ -180,7 +180,7 @@ Options used to create the (implicit) default client.
180180```
181181
182182Convenience wrapper for [ ` request ` ] ( #babashka.http-client/request ) with method ` :delete `
183- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L133-L138 " >Source</a ></sub ></p >
183+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L134-L139 " >Source</a ></sub ></p >
184184
185185## <a name =" babashka.http-client/get " >` get ` </a ><a name =" babashka.http-client/get " ></a >
186186``` clojure
@@ -190,7 +190,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
190190```
191191
192192Convenience wrapper for [ ` request ` ] ( #babashka.http-client/request ) with method ` :get `
193- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L126-L131 " >Source</a ></sub ></p >
193+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L127-L132 " >Source</a ></sub ></p >
194194
195195## <a name =" babashka.http-client/head " >` head ` </a ><a name =" babashka.http-client/head " ></a >
196196``` clojure
@@ -200,7 +200,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
200200```
201201
202202Convenience wrapper for [ ` request ` ] ( #babashka.http-client/request ) with method ` :head `
203- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L140-L145 " >Source</a ></sub ></p >
203+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L141-L146 " >Source</a ></sub ></p >
204204
205205## <a name =" babashka.http-client/patch " >` patch ` </a ><a name =" babashka.http-client/patch " ></a >
206206``` clojure
@@ -210,7 +210,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
210210```
211211
212212Convenience wrapper for [ ` request ` ] ( #babashka.http-client/request ) with method ` :patch `
213- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L154-L161 " >Source</a ></sub ></p >
213+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L155-L162 " >Source</a ></sub ></p >
214214
215215## <a name =" babashka.http-client/post " >` post ` </a ><a name =" babashka.http-client/post " ></a >
216216``` clojure
@@ -220,7 +220,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
220220```
221221
222222Convenience wrapper for [ ` request ` ] ( #babashka.http-client/request ) with method ` :post `
223- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L147-L152 " >Source</a ></sub ></p >
223+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L148-L153 " >Source</a ></sub ></p >
224224
225225## <a name =" babashka.http-client/put " >` put ` </a ><a name =" babashka.http-client/put " ></a >
226226``` clojure
@@ -230,7 +230,7 @@ Convenience wrapper for [`request`](#babashka.http-client/request) with method `
230230```
231231
232232Convenience wrapper for [ ` request ` ] ( #babashka.http-client/request ) with method ` :put `
233- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L163-L170 " >Source</a ></sub ></p >
233+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L164-L171 " >Source</a ></sub ></p >
234234
235235## <a name =" babashka.http-client/request " >` request ` </a ><a name =" babashka.http-client/request " ></a >
236236``` clojure
@@ -247,7 +247,9 @@ Perform request. Returns map with at least `:body`, `:status`
247247 * ` :headers ` - a map of headers
248248 * ` :method ` - the request method: ` :get ` , ` :post ` , ` :head ` , ` :delete ` , ` :patch ` or ` :put `
249249 * ` :interceptors ` - custom interceptor chain
250- * ` :client ` - a client as produced by [ ` client ` ] ( #babashka.http-client/client ) . If not provided a default client will be used.
250+ * ` :client ` - a client as produced by [ ` client ` ] ( #babashka.http-client/client ) or a clojure function. If not provided a default client will be used.
251+ When providing : client with a a clojure function, it will be called with the Clojure representation of
252+ the request which can be useful for testing.
251253 * ` :query-params ` - a map of query params. The values can be a list to send multiple params with the same key.
252254 * ` :form-params ` - a map of form params to send in the request body.
253255 * ` :body ` - a file, inputstream or string to send as the request body.
@@ -259,8 +261,7 @@ Perform request. Returns map with at least `:body`, `:status`
259261 * ` :timeout ` - request timeout in milliseconds
260262 * ` :throw ` - throw on exceptional status codes, all other than ` #{200 201 202 203 204 205 206 207 300 301 302 303 304 307} `
261263 * ` :version ` - the HTTP version: ` :http1.1 ` or ` :http2 ` .
262-
263- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L100-L124 " >Source</a ></sub ></p >
264+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client.clj#L100-L125 " >Source</a ></sub ></p >
264265
265266-----
266267# <a name =" babashka.http-client.interceptors " >babashka.http-client.interceptors</a >
@@ -293,15 +294,15 @@ Request: adds `:authorization` header based on `:basic-auth` (a map
293294
294295
295296Request: construct uri from map
296- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L220-L226 " >Source</a ></sub ></p >
297+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L222-L228 " >Source</a ></sub ></p >
297298
298299## <a name =" babashka.http-client.interceptors/decode-body " >` decode-body ` </a ><a name =" babashka.http-client.interceptors/decode-body " ></a >
299300
300301
301302
302303
303304Response: based on the value of ` :as ` in request, decodes as ` :string ` , ` :stream ` or ` :bytes ` . Defaults to ` :string ` .
304- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L208-L218 " >Source</a ></sub ></p >
305+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L208-L220 " >Source</a ></sub ></p >
305306
306307## <a name =" babashka.http-client.interceptors/decompress-body " >` decompress-body ` </a ><a name =" babashka.http-client.interceptors/decompress-body " ></a >
307308
@@ -317,7 +318,7 @@ Response: decompresses body based on "content-encoding" header. Valid values: `
317318
318319
319320Default interceptor chain. Interceptors are called in order for request and in reverse order for response.
320- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L253-L264 " >Source</a ></sub ></p >
321+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L256-L267 " >Source</a ></sub ></p >
321322
322323## <a name =" babashka.http-client.interceptors/form-params " >` form-params ` </a ><a name =" babashka.http-client.interceptors/form-params " ></a >
323324
@@ -333,7 +334,7 @@ Request: encodes `:form-params` map and adds `:body`.
333334
334335
335336Adds appropriate body and header if making a multipart request.
336- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L241-L251 " >Source</a ></sub ></p >
337+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L244-L254 " >Source</a ></sub ></p >
337338
338339## <a name =" babashka.http-client.interceptors/oauth-token " >` oauth-token ` </a ><a name =" babashka.http-client.interceptors/oauth-token " ></a >
339340
@@ -358,13 +359,13 @@ Request: encodes `:query-params` map and appends to `:uri`.
358359
359360
360361Response: throw on exceptional status codes
361- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L231-L239 " >Source</a ></sub ></p >
362+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L233-L242 " >Source</a ></sub ></p >
362363
363364## <a name =" babashka.http-client.interceptors/unexceptional-statuses " >` unexceptional-statuses ` </a ><a name =" babashka.http-client.interceptors/unexceptional-statuses " ></a >
364365
365366
366367
367- <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L228-L229 " >Source</a ></sub ></p >
368+ <p ><sub ><a href =" https://github.com/babashka/http-client/blob/main/src/babashka/http_client/interceptors.clj#L230-L231 " >Source</a ></sub ></p >
368369
369370## <a name =" babashka.http-client.interceptors/uri-with-query " >` uri-with-query ` </a ><a name =" babashka.http-client.interceptors/uri-with-query " ></a >
370371``` clojure
0 commit comments