Czar
01/02/2019, 8:59 AMHttpClientEngine
and overriding reset
does not work, because reset()
is called in the parent constructor. To make it work I have to initilize Rest
like this:
Rest.engineProvider = ::CustomHttpEngine
api.baseURI = "<https://example.com/api>"
api.reset()
IntelliJ is even warning about the fragility of calling an open method in parent constructor 🙂
Another problem - no way to get cookies from the response. I can easily implement it locally, but at this point I'll probably just wire in something like Spring's rest template, as I'm more interested in the UI part than fixing plumbing 🙂