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

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -

ios - Memory not freeing up after popping viewcontroller using ARC -