其中的Apache HTTP组件添加到摇篮多部分形式 [英] which apache http component to add to gradle for multipart-form

查看:187
本文介绍了其中的Apache HTTP组件添加到摇篮多部分形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题其实是一个跟进<一个href=\"http://stackoverflow.com/questions/11164398/android-upload-video-to-remote-server-using-http-multipart-form-data?lq=1\">Android使用HTTP多部分的表单数据视频上传到远程服务器

我需要知道哪些依赖添加到摇篮为code工作。我尝试如下,但它不能正常工作

  //的Apache HTTP客户端
编译org.apache.httpcomponents:httpmime:4.5.1
编译org.apache.httpcomponents:HttpClient的:4.5.1


解决方案

正如我在下面的问题已经回答了:

Android项目使用的HttpClient 4.5

您可以使用 HttpClient的为Android 4.3.5 代替。

不过,因为从API22 Apache的librabry,对德precation的建议你使用HttpURLConnection类,OkHttp ......来代替。

您应该多读<一个href=\"https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client\"相对=nofollow> Apache的HTTP客户端删除

My question is actually a follow up to Android upload video to remote server using HTTP multipart form data

I need to know which dependencies to add to gradle for the code to work. I tried as below but it does not work

//apache http client
compile 'org.apache.httpcomponents:httpmime:4.5.1'
compile 'org.apache.httpcomponents:httpclient:4.5.1'

解决方案

As I have answered at the following question:

Android project uses HttpClient 4.5

You can use HttpClient for Android 4.3.5 instead.

However, because of the deprecation of Apache's librabry from API22, suggest that you use HttpUrlConnection, OkHttp... instead.

You should read more Apache HTTP Client Removal

这篇关于其中的Apache HTTP组件添加到摇篮多部分形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆