在我的应用程序中使用https发送请求,方法是此来源答案。现在其中一些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连接中使用弃用的方法,请考虑使用改造即可。它是第三方库,它使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主页的链接: square.github.io/retrofit/
Here is the link to the Retrofit github homepage: square.github.io/retrofit/
更多推荐
android发送https发布请求到服务器没有弃用的metods
发布评论