12345678910111213141516171819202122232425262728293031323334 |
- package qh.lqg.test;
- import java.io.IOException;
- import java.util.ArrayList;
- import qh.lqg.utils.net.HTTPParam;
- import qh.lqg.utils.net.HTTPSend;
- public class TestHTTPSend {
- private ArrayList<HTTPParam> param = new ArrayList<HTTPParam>();
- private String result;
- private String url;
- public static void main(String[] args) throws IOException {
- // TODO 自动生成的方法存根
- TestHTTPSend testHTTPSend = new TestHTTPSend();
- // testHTTPSend.testGet();
- testHTTPSend.testPost();
- }
- public void testGet() throws IOException {
- url = "http://www.cnblogs.com/zhuawang/archive/2012/12/08/2809380.html";
- // HTTPParam httpParam = new HTTPParam();
- // param.add(httpParam);
- result = HTTPSend.sendGet(url, param);
- System.out.println(result);
- }
- public void testPost() throws IOException {
- String url = "http://www.cnblogs.com/zhuawang/archive/2012/12/08/2809380.html";
- result = HTTPSend.sendPost(url, param);
- System.out.println(result);
- }
- }
|