Expand description
The one place HTTP requests are made and errors mapped.
Shared HTTP plumbing: one pooled [reqwest::Client] per controller, one
place that maps transport and status-code failures to UnifiError.
UnifiClient and the dynamic action dispatcher both
call request_json with the same borrowed
Client rather than each building their own — a fresh reqwest::Client
per call defeats connection pooling and keep-alive under load, so build
one with build_client and reuse it for the
client’s lifetime.
Functions§
- build_
client - Builds the pooled HTTP client used for every request against one controller.
- request_
json - Issues one request against
base_urlusing the caller-suppliedclient, and maps the transport/status outcome into aResult.