I am using finagle
as rest
client. In ClientBuilder
I specify a range of hosts, but the request requires setting a url with host.
How can I avoid specifying host in the request and let finagle choose one ?
Thanks.
val client = ClientBuilder().hosts("host1:81,host2:82").codec(Http()).build()
val request = RequestBuilder()
// .url("http://host1/get") // dont want to specify host
// .url("/get") // MalformedURLException: no protocol
.buildGet()
var resp = client(request) // sent to host specified by url