摘要:
1)使用HttpClient发送GET请求 2)使用HttpClient发送POST请求 HttpClient抓数据示例(教务系统数据抓取) HttpClient可以通过下述代码获取与设置Cookie: HttpResponse loginResponse = new DefaultHttpClie 阅读全文
摘要:
创建一个URL对象: URL url = new URL(http://www.baidu.com); 调用URL对象的openConnection( )来获取HttpURLConnection对象实例: HttpURLConnection conn = (HttpURLConnection) ur 阅读全文
摘要:
public class StreamTool { //从流中读取数据 public static byte[] read(InputStream inStream) throws Exception{ ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] buf... 阅读全文