http网络请求 基础


http://tuijian.hao123.com:80/index.html
scheme(协议前缀): host(主机):port(端口):path(资源路径)

核心类:
URL:网络统计资源定位符 ,标识是网络中唯一资源
HttpURLConnection 网络资源连接类,可以打开网络连接,读取网路资源,上传网路资源等
功能方法:getinputStream()来获取网路资源字节读取流
getContentLength()来获取网路资源字节数
getPesponseCode() 来获取网路资源的响应码,如果是200,则表示资源请求成功。

 

posted @ 2017-06-27 22:29  lxj666  阅读(158)  评论(0编辑  收藏  举报