HTTP client for pull-based APIs.
Provides a simple way to interact with remote pull APIs from the REPL.
(def api (connect "http://localhost:8080/api"))
;; Pull data
(api '{:posts ?posts})
;; With params
(api '{:post {:title ?t}} {:post-id 1})
;; Introspect schema
(schema api)
HTTP client for pull-based APIs.
Provides a simple way to interact with remote pull APIs from the REPL.
```clojure
(def api (connect "http://localhost:8080/api"))
;; Pull data
(api '{:posts ?posts})
;; With params
(api '{:post {:title ?t}} {:post-id 1})
;; Introspect schema
(schema api)
```(connect url)(connect url {:keys [format client] :or {format :transit-json}})Create a connection to a pull API endpoint.
Returns a function that executes pull patterns: (def api (connect "http://localhost:8080/api")) (api '{:posts ?posts}) (api '{:post {:title ?t}} {:post-id 1})
Options:
Create a connection to a pull API endpoint.
Returns a function that executes pull patterns:
(def api (connect "http://localhost:8080/api"))
(api '{:posts ?posts})
(api '{:post {:title ?t}} {:post-id 1})
Options:
- :format - Wire format (:transit-json, :transit-msgpack, :edn). Default :transit-json
- :client - Custom HttpClient instance(schema api-fn)Fetch schema from a connected API.
(schema api)
Fetch schema from a connected API. (schema api)
(url api-fn)Get the URL of a connected API.
Get the URL of a connected API.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |