If you have a function like this:
(defn make-request
[request]
(http/with-additional-middleware [...]
(http/request request)))
And you call it with mocking, like so:
(binding [http/request (http/make-request (constantly {:status 201}))]
(make-request {...}))
Then the default client (clj-http.core/request) will be used instead of (constantly {:status 201}). This is due to with-middleware rebinding http/request itself
If you have a function like this:
And you call it with mocking, like so:
Then the default client (clj-http.core/request) will be used instead of
(constantly {:status 201}). This is due towith-middlewarerebindinghttp/requestitself