android发送https发布请求到服务器没有弃用的metods [英] android send https post request to the server without deprecated metods

查看:121
本文介绍了android发送https发布请求到服务器没有弃用的metods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中使用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主页的链接:
http://square.github.io/retrofit/

Here is the link to the Retrofit github homepage: http://square.github.io/retrofit/

这篇关于android发送https发布请求到服务器没有弃用的metods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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