安卓中链接网络
httpURLConnection java标准
httpClient 阿帕奇提供
通信方式
post方式
get方式
注:需添加网络权限,并且在子线程中执行
httpURLConnection :
将访问路径封装成url对象
通过url对象获取到httpURLConnection
设置链接参数
连接到服务器
向服务器发送数据
读取 返回数据
关闭服务
安卓中链接网络
httpURLConnection java标准
httpClient 阿帕奇提供
通信方式
post方式
get方式
注:需添加网络权限,并且在子线程中执行
httpURLConnection :
将访问路径封装成url对象
通过url对象获取到httpURLConnection
设置链接参数
连接到服务器
向服务器发送数据
读取 返回数据
关闭服务