clj-http icon indicating copy to clipboard operation
clj-http copied to clipboard

:response-interceptor example in README doesn't seem to work

Open atroche opened this issue 7 years ago • 1 comments

On master, when I tried out this snippet from https://github.com/dakrone/clj-http/tree/master#debugging:

(client/get "http://example.org" {:response-interceptor (fn [resp ctx] (println ctx))})

I got this:

#error {
 :cause "No matching method found: addInterceptorLast for class org.apache.hc.client5.http.impl.classic.HttpClientBuilder"
 :via
 [{:type java.lang.IllegalArgumentException
   :message "No matching method found: addInterceptorLast for class org.apache.hc.client5.http.impl.classic.HttpClientBuilder"
   :at [clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 53]}]
 :trace
 [[clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 53]
  [clojure.lang.Reflector invokeInstanceMethod "Reflector.java" 28]
  [clj_http.core$build_http_client invokeStatic "core.clj" 348]
  [clj_http.core$build_http_client doInvoke "core.clj" 298]
  [clojure.lang.RestFn invoke "RestFn.java" 494]
  [clj_http.core$request invokeStatic "core.clj" 635]
  [clj_http.core$request invoke "core.clj" 557]
  [clj_http.core$request invokeStatic "core.clj" 558]
  [clj_http.core$request invoke "core.clj" 557]
  [clojure.lang.Var invoke "Var.java" 381]
  [clj_http.client$wrap_request_timing$fn__6052 invoke "client.clj" 978]
  [clj_http.headers$wrap_header_map$fn__3046 invoke "headers.clj" 148]
  [clj_http.client$wrap_query_params$fn__5932 invoke "client.clj" 712]
  [clj_http.client$wrap_basic_auth$fn__5938 invoke "client.clj" 735]

(SNIP)

No idea if this is a useful thing to point out (e.g. maybe that feature is getting dropped but it's not time to update the docs on master yet).

atroche avatar Apr 26 '18 12:04 atroche

@atroche sorry for the confusion, you should use the 3.x branch for now. I've made it the new default branch for github. master is where I'm currently working on the Apache 5 upgrade, so things are in a state of flux

dakrone avatar Apr 27 '18 16:04 dakrone