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

AlternativeHttpClientImplのインスタンスからOkHttpClientを取得できるようにgetterの追加 #274

Merged
merged 2 commits into from
Aug 11, 2018

Conversation

moko256
Copy link
Contributor

@moko256 moko256 commented Dec 30, 2017

AlternativeHttpClientImpl#getOkHttpClient()を追加しました

twitter4j-http2-supportを使ってる時に、TwitterからOkHttpClientを取るときに、以下のコードでリフレクション無しでOkHttpClientインスタンスを取れるようになります

Twitter twitter = new TwitterFactory().getInstance();
HttpClient httpClient = HttpClientFactory.getInstance(twitter.getConfiguration().getHttpClientConfiguration());
if (httpClient instanceof AlternativeHttpClientImpl) {
    OkHttpClient client = ((AlternativeHttpClientImpl) httpClient).getOkHttpClient();
}

@yusuke yusuke merged commit 490da14 into Twitter4J:master Aug 11, 2018
@moko256 moko256 deleted the add_getter_of_okhttpclient branch November 6, 2018 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants