Interface HttpClient
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
ApacheHttpClient
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidapply(KarateConfig config) Apply a typed configuration snapshot.invoke(HttpRequest request)
-
Method Details
-
invoke
-
apply
Apply a typed configuration snapshot.KarateConfigis the single source of truth — implementations read every relevant setting via its typed getters and (re)build their internal client state.Must be idempotent: an implementation may not tear down or rebuild anything when the settings it cares about are unchanged. This is a requirement rather than an optimisation, because it is what lets callers stop deciding. Config reaches a client from four places — a
configure <key>step, a shared-scope call returning, a callee inheriting from its caller, and a cachedcalloncereplaying — and the last three copy a whole config across a scenario boundary with no key to test. Any caller-side shortcut therefore has to be conservative on those paths, which means rebuilding a live client and its connection pool for a config that did not change. Deciding here, against the settings actually in use, is the only place the question can be answered exactly.Callers should call this whenever config may have changed and let the implementation sort it out. They must not try to predict the answer.
-
abort
void abort()
-