An extrapolation of this into http4k could be a v...
# http4k
d
An extrapolation of this into http4k could be a variant of the Client and Request that use an indirection of some sort instead of the explicit hostnames
n
We do something like this, using filters to replace abstract service URIs with absolute HTTP URLs. This way, there’s no need for a special variant of client or request. It all falls out nicely of HTTP4K’s existing abstractions.
d
yep - you can simply provide a simple filter which will replace the hostname - we do this already in
ClientFilters.SetBaseUriFrom
. This means that your API client code can just set the path and method, like
Request(GET, "/api/bob")
and let the underlying httphandler which you are calling do the discovery of the hostname