Android截击:多部分请求。使用ApacheHTTP库

Android截击:多部分请求。使用ApacheHTTP库,android,apache,http,Android,Apache,Http,我一直在尝试使用截击来上传文件。我使用以下参考代码: 在参考代码中使用了一些库,例如:MultipartEntityBuilder、FileBody。 在gradle依赖项中,我添加了以下依赖项: compile 'org.apache.httpcomponents:httpmime:4.3' compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5' 但在emulat

我一直在尝试使用截击来上传文件。我使用以下参考代码:

在参考代码中使用了一些库,例如:MultipartEntityBuilder、FileBody。 在gradle依赖项中,我添加了以下依赖项:

compile 'org.apache.httpcomponents:httpmime:4.3'
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'
但在emulator中测试应用程序后,出现以下错误:

java.lang.noclassdeffounderror: org.apache.http.entity.contenttype
Error:Failed to find: org.apache.httpcomponents:httpclient-android:4.3.5
在Android中导入Apache HTTP库的正确方法是什么? 我已尝试添加以下依赖项:

compile 'org.apache.httpcomponents:httpmime:4.3'
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'
但是我得到了以下错误:

java.lang.noclassdeffounderror: org.apache.http.entity.contenttype
Error:Failed to find: org.apache.httpcomponents:httpclient-android:4.3.5
例如:


如果你使用截击,那么你不需要所有这些东西。只有截击。嗨。谢谢你的回答。我认为Volley不支持多部分请求。这就是为什么我认为我们需要使用ApacheHTTP库将Volley与多部分请求集成在一起。