dakrone / dakrone/clj-http

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

Open
#447 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
1.8k
Forks
410
PR merge metrics
No merged PRs in 30d

Description

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the README Debugging section's response-interceptor example, then inspect clj_http.core/build_http_client around core.clj line 348 where the reported failure occurs. Determine whether the example or the implementation is outdated, and finish when the documented example works or the README accurately describes the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.