-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept a HttpClient.Builder Supplier (Http Module) #102
Comments
hi, |
It seems I was not clear. Let me try again. I’d like to control what type of Builder is used. What I need cannot be achieved via customizing the builder (e.g. logging request and response body which seems to be possible only by extending the underlying client). I was referencing the |
Thanks for clarification but I think I'm still not on the same page. Can you add some more detailed example? |
OK, what's my problem? I'd like to log request and response bodies fully. For OkHttp it's as simple as just adding the logging interceptor. But for JDK HttpClient, it's not possible. It provide some logging but very ugly and don't log request/response bodies. Now, interestingly (unfortunately) it doesn't seem to be easily possible to achieve this by "just customizing" the client. One solution people suggested is to extend the |
Ok, take a look at #104 if it solves your issue |
If I understand this correctly, the code (
com.agorapulse.gru.http.Http#run
) creates a builder directly inside the method. And there's no way for the developer to override the HttpClient implementation. One use case is to be able to log request/response bodies (which is impossible using the existing functionalities). Would be nice to accept aSupplier<HttpClient.Builder>
or some other mechanism to be able to override the exact concrete implementation of theHttpClient
.The text was updated successfully, but these errors were encountered: