Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Get rid of org.apache.http.legacy #31

Open
MasterEmit opened this issue May 10, 2016 · 0 comments
Open

Get rid of org.apache.http.legacy #31

MasterEmit opened this issue May 10, 2016 · 0 comments

Comments

@MasterEmit
Copy link

MasterEmit commented May 10, 2016

We are using at the moment Apache Android HttpClient 4.3.5.1. Sadly we still need useLibrary 'org.apache.http.legacy' to be able to build.

We need HttpComponentsStreamingClientHttpRequest - otherwise we would switch to okHttpClient.

If we remove legacy apache library and add in addition "org.apache.httpcomponents:core:4.3.3", then we get compile errors for following code:

private void setTemplateRequestFactory(RestTemplate template, CloseableHttpClient httpClient, boolean isSupportLargeRequests) {
        HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
        requestFactory.setBufferRequestBody(!isSupportLargeRequests);
        template.setRequestFactory(requestFactory);
    }

The constructor of HttpComponentsClientHttpRequestFactory needs HttpClient - which is just available inside legacy apache http client. Would it be possible to remove this dependency?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant