Skip to content
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

Documentation: Clearly state that OkHttpClient should be a singleton #8353

Open
jfontsaballs opened this issue Apr 8, 2024 · 6 comments
Open
Labels
bug Bug in existing code

Comments

@jfontsaballs
Copy link

I learned from StackOverflow that a single instance of OkHttpClient should be created and that it should be shared among all services in the application that need to communicate via HTTP. I haven't been able to find anything definitive in the docs on how the OkHttpClient is designed to be used.

I'd like to request that this information be included in the overview page of the docs https://square.github.io/okhttp/ in order to have a trustworthy and easy to find source for that piece of information. All examples in the docs just create a new instance of the client.

@jfontsaballs jfontsaballs added the bug Bug in existing code label Apr 8, 2024
@yschimke
Copy link
Collaborator

yschimke commented Apr 8, 2024

Yep, it should probably go on the main doc page.

It's here currently https://square.github.io/okhttp/5.x/okhttp/okhttp3/-ok-http-client/index.html

image

@madd-44

This comment was marked as off-topic.

@madd-44

This comment was marked as off-topic.

@madd-44

This comment was marked as off-topic.

@madd-44

This comment was marked as off-topic.

@madd-44

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in existing code
Projects
None yet
Development

No branches or pull requests

3 participants