@@ -23,11 +23,18 @@ toc::[]
2323
2424== Installation
2525
26- `clj-http-lite` is available as a Maven artifact from https://clojars.org/org.clj-commons/clj-http-lite[Clojars]:
26+ Clojure cli users, add the following under `:deps` in your `deps.edn` file. +
27+ Babashka users, add the following under `:deps` in your `bb.edn` file:
28+ [source,clojure,subs="attributes+"]
29+ ----
30+ org.clj-commons/clj-http-lite {:mnv/version "{lib-version}"}
31+ ----
32+
33+ Lein users, add the following into the `:dependencies` vector in your `project.clj` file:
2734
2835[source,clojure,subs="attributes+"]
2936----
30- [org.clj-commons/clj-http-lite "{lib-version}"]
37+ [org.clj-commons/clj-http-lite "{lib-version}"]
3138----
3239
3340== Differences from clj-http
@@ -39,7 +46,7 @@ toc::[]
3946* No multipart form uploads
4047* No persistent connection support
4148* Fewer options
42- * namespace rename clj-http.* -> clj-http.lite.*
49+ * namespace rename ` clj-http.*` -> ` clj-http.lite.*`
4350
4451Like its namesake, clj-http-lite is light and simple, but ping us if there is some clj-http feature you’d like to see in clj-http-lite.
4552We can discuss.
@@ -54,7 +61,7 @@ We can discuss.
5461== Usage
5562
5663=== General
57- The main HTTP client functionality is provided by the `clj-http.lite.client` namespace:
64+ HTTP client functionality is provided by the `clj-http.lite.client` namespace:
5865
5966[source,clojure]
6067----
@@ -75,7 +82,7 @@ They all return Ring-style response maps:
7582 :body "<!doctype html>..."}
7683----
7784
78- TIP: We encourage you to try out these examples in your REPL, `httpbin.org` is a free HTTP test playground and used in many examples.
85+ TIP: We encourage you to try out these examples in your REPL, `httpbin.org` is a free HTTP test playground and used in many of our examples.
7986
8087[source,clojure]
8188----
@@ -226,7 +233,8 @@ A more general `request` function is also available, which is useful as a primit
226233
227234=== Exceptions
228235
229- The client will throw exceptions on, exceptional HTTP status codes. Clj-http-lite throws an `ex-info` with the response as `ex-data`.
236+ When a server returns an exceptional HTTP status code, by default, clj-http-lite throws an `ex-info` exception.
237+ The response is included as `ex-data`.
230238
231239[source,clojure]
232240----
@@ -240,14 +248,15 @@ The client will throw exceptions on, exceptional HTTP status codes. Clj-http-lit
240248;; => (:headers :status :body)
241249----
242250
243- You can suppress HTTP status exceptions and handle them yourself:
251+ You can suppress HTTP status exceptions and handle them yourself via the `:throw-exceptions` option :
244252
245253[source,clojure]
246254----
247255(client/get "https://httpbin.org/404" {:throw-exceptions false})
248256----
249257
250- Or ignore an unknown host (methods return `nil' if this is set to true and the host does not exist:
258+ You can choose to ignore an unknown host via `:ingore-unknown-host?` option.
259+ When enabled, requests return `nil` if the host is not found.
251260
252261[source,clojure]
253262----
@@ -393,7 +402,7 @@ $ bb lint
393402
394403=== Release
395404
396- To release a new version, run `bb publish` which will push a new tag.
405+ To release a new version, run `bb publish` which will push a new tag.
397406CI will take care of the rest.
398407
399408== License
0 commit comments