can't use HttpPost in Android Studio after successful Gradle sync -


i'm trying use httppost did in past in android. realize has been removed recent android versions. following solutions on similar stackoverflow question, added gradle dependencies:

compile 'org.apache.httpcomponents:httpcore:4.4.1' compile 'org.apache.httpcomponents:httpclient:4.5' 

after gradle sync complained of no errors, still cannot import httppost program. in fact, org.apache.http.client.methods package not resolve @ all.

i tried apache httpclient website suggested, use instead in gradle dependencies:

compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1' 

once again, sync went fine, , time package resolved, not httppost program.

enter image description here

i'd grateful suggestions.

just add line in build.gradle inside android plugin :

uselibrary 'org.apache.http.legacy' 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -