Liking cljdoc? Tell your friends :D


Provide tools to keep a config map around a default clj-http request and do relative manipulation to it -- for now or maybe ever: client only.

Clojars Project cljdoc badge


Some examples:

; require
user=> (require '[relative-clj-http.client :as c])

; a default config for convenience
user=> c/default-config
{:base-url "http://localhost:8080"
 :request {:as :auto :coerce :always :debug false :throw-exceptions false}}

; create a config and adjust the base
user=> (def config (-> c/default-config (c/cd "")))
user=> config
{:base-url ""
 :current-url ""
 :previous-url ""
 :request {:as :auto :coerce :always :debug false :throw-exceptions false}}

; relative request with that config
user=> (c/request config :get "/get")
{:body "{\n  \"args\": {}, \n  \"headers\": {\n    \"Accept-Encoding\": \"gzip, deflate\", ..."
 :content-type :application/json
 :status 200
 ; ...


Copyright © 2019 Christoph Frick

Released under the MIT License:

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close