1 # Gemini library for clojure
3 `gemini.core` is a clojure library to make Gemini requests.
9 user=> (require '[gemini.core :as gemini])
14 `fetch` makes a Gemini request and returns a map with `:request`,
15 `:meta`, `:code` and `:body` as keys, or `:error` if an error occur.
17 The request needs to be closed afterwards using `close`, or calling
18 the `.close` method on the `:request` object.
21 user=> (gemini/fetch "gemini://gemini.circumlunar.space/")
23 #object[com.omarpolo.gemini.Request 0x3b270767 "com.omarpolo.gemini.Request@3b270767"],
24 :meta "gemini://gemini.circumlunar.space/",
27 #object[java.io.BufferedReader 0x49358b66 "java.io.BufferedReader@49358b66"]}
32 Read all the response into a string and returns it. It also closes
33 the request automatically.
36 user=> (-> (gemini/fetch "gemini://gemini.circumlunar.space/")
37 gemini/body-as-string!)
38 "# Project Gemini\n\n## Overview\n\nGemini is a new internet protocol which..."
47 Like `with-open`, but specifically for the requests:
50 user=> (with-request [req (fetch "gemini://gemini.circumlunar.space/")]