I am really sorry to contact again.  I am still a little confused.

I am confused as to how to make this work with these dependancies as I think was suggested:

    implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-beta7'
    implementation 'org.apache.httpcomponents.client5:httpclient5:5.0-beta3'

If I use for example org.apache.http.client.entity.UrlEncodedFormEntityHC4

its constructor cannot be resolved since

public UrlEncodedFormEntityHC4 (
        final List <? extends NameValuePair> parameters,
        final String charset)

is refering to org.apache.http.NameValuePair which with these dependancies
does not exist only org.apache.hc.core5.http.NameValuePair.

Ought I to be simply using an older version of client and core or will this
create other conflicts?  Which versions would be best?

Sorry again.

Thank you.




On 26/03/2019 08:02, Oleg Kalnichevski wrote:
On Tue, 2019-03-26 at 01:26 +0000, Andrew Hardy wrote:
Hi,


Thank you so much for all your work in porting
org.apache.httpcomponents:httpclient to Android.  I appreciate the
benefits you are making available.  I am in the process of up
versioning
some old Android code that used httpclient and I am swapping for you
Android port.  I have run into a little difficulty and I wonder if
you
would be so kind as to help me understand where I am going wrong.

I am using the following dependancies:

      implementation 'org.apache.httpcomponents:httpclient-
android:4.3.5.1'
      implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-
beta7'

However, there are still 7 Classes which I used in my old code which
I
cannot now find in either httpclient-android nor httpcore5, either
same
named or renamed.  I would be very grateful if you could point me in
the
right direction

import org.apache.http.client.ClientProtocolException; // cannot find
in
httpclient-android but is in original client 4.0
import org.apache.http.client.HttpClient; // cannot find in
httpclient-android but is in original client 4.0
import org.apache.http.client.protocol.ClientContext; // cannot find
in
httpclient-android but is in original client 4.0
import org.apache.http.cookie.Cookie; // cannot find in
httpclient-android but is in original client 4.5
import org.apache.http.client.CookieStore; // cannot find in
httpclient-android but is in original client 4.0
import org.apache.http.impl.client.DefaultHttpClient; // cannot find
in
httpclient-android but is in original client 4.5
import org.apache.http.protocol.HTTP; // cannot find

Many thanks indeed.

Those are HttpClient classes. Please use HttpClient 5.0, not just
HttpCore 5.0

Here is a HttpClient 5.0 migration guide that you may find useful.

https://ok2c.github.io/httpclient-migration-guide/

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---
This email has been checked for viruses by AVG.
https://www.avg.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to