Java 如何下载 org.apache.http 包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32309780/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 12:20:10  来源:igfitidea点击:

how can I download org.apache.http packages

javaandroid

提问by vahni

I am beginner in android application development. I was trying database connection and I get error in my code for the following packages. Please tell me where can I download these packages , how to use them?

我是android应用程序开发的初学者。我正在尝试数据库连接,但在我的以下包的代码中出现错误。请告诉我在哪里可以下载这些软件包,如何使用它们?

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;

回答by Francisco Romero

You can download it from here: Apache HttpComponents

你可以从这里下载:Apache HttpComponents

回答by AndiGeeky

If you are using,

如果您正在使用,

1. Android Studio :

1.安卓工作室:

then add this dependancy in your build.gradle at application level :

然后在应用程序级别的 build.gradle 中添加此依赖项:

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

2. Eclipse :

2. 日蚀:

Download this library as a jar and put it in your libs folder

将此库下载为 jar 并将其放入您的 libs 文件夹中

HttpCore : http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.4.1

HttpCore : http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.4.1

HttpClient : http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5

HttpClient : http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5