A usecase would be to configure the read and connect timeouts. Currently, the only possibility to do this is e.g.
new Client(new AccessTokenDispatcher(personalAccessToken) {
@Override
public HttpRequest buildRequest(String method, GenericUrl url, HttpContent content) throws IOException {
HttpRequest request = httpTransport.createRequestFactory(req -> {
req.setConnectTimeout(connectTimeout);
req.setReadTimeout(readTimeout);
}).buildRequest(method, url, content);
request.getHeaders().setAuthorization("Bearer " + personalAccessToken);
return request;
}
});
This is problematic because I had to copy over code from the underlying AccessTokenDispatcher and Dispatcher classes.
There are already methods on the Client object taking a HttpTransport object, but due to the nature of the used Http libraries there's no way to construct a HttpTransport object with a HttpRequestInitializer since even the createRequestFactory methods are final.
I guess the easiest solution would be to provide a method on the Client object taking a HttpRequestIntializer.
┆Issue is synchronized with this Asana task
A usecase would be to configure the read and connect timeouts. Currently, the only possibility to do this is e.g.
This is problematic because I had to copy over code from the underlying
AccessTokenDispatcherandDispatcherclasses.There are already methods on the
Clientobject taking aHttpTransportobject, but due to the nature of the used Http libraries there's no way to construct aHttpTransportobject with aHttpRequestInitializersince even thecreateRequestFactorymethods are final.I guess the easiest solution would be to provide a method on the
Clientobject taking aHttpRequestIntializer.┆Issue is synchronized with this Asana task