您的位置:首页 > 理论基础 > 计算机网络

android网络编程

2015-06-11 20:23 495 查看
Created with Raphaël 2.1.2客户端客户端服务器服务器发送http请求发送http数据解析和处理

Created with Raphaël 2.1.2发送http请求选择HttpClientHttpUrlConnectionyesno

URL url = new URL("http://www.baidu.com");
HttpURLConnection connection = (HttpConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setConnectTimeout(8000);
connection.setReadTimeout(8000);
InputStream in = connection.getInputStream();
connection.disconnect();


Created with Raphaël 2.1.2HttpURLConnectionHttpURLConnectionsetRequestMethod("GET");setConnectTimeout(8000)setReadTimeout(8000)getInputStream()disconnect()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: