Android不使用不推荐使用的方法向服务器发送https发布请求 [英] Android send https post request to the server without deprecated methods
问题描述
在我的应用中,通过使用此来源答案.现在,其中的某些apache方法已被弃用.谁能帮助我以新的方式解决问题?
In my app is used send request by https by following this source answer. Now some of them apache methods deprecated. Can anyone help me in order solve in a new approach?
推荐答案
为避免在API连接中使用不推荐使用的方法,请考虑使用 Retrofit .这是一个第三方库,使HTTP通信更加简单.
To avoid using deprecated methods in API connectivity, think about using Retrofit. It's a third party library which makes HTTP communication much simpler.
使用Retrofit时,可以创建API端点的接口,并将其用作方法. HTTP请求的其余部分由库管理.
When using Retrofit, you can create an interface of an API endpoint and the use it like a method. The rest of the HTTP request is managed by the library.
以下是Retrofit github主页的链接: http://square.github.io/retrofit/
Here is the link to the Retrofit github homepage: http://square.github.io/retrofit/
这篇关于Android不使用不推荐使用的方法向服务器发送https发布请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!