04 2016 档案
HttpClient——POST请求方法
摘要:CloseableHttpClient httpClient = HttpClients.createDefault(); //如果发送是POST请求,创建HttpPost对象 HttpPost httppost = new HttpPost("http://localhost:8080/login"); //post请求参数配置 List formparams = new Arra... 阅读全文
posted @ 2016-04-28 14:04 TestJ 阅读(1563) 评论(0) 推荐(0)
【Httpclient+TestNG】接口自动化测试——GET请求示例
摘要:1 import net.sf.json.JSONArray; 2 import net.sf.json.JSONObject; 3 import org.apache.http.client.config.RequestConfig; 4 import org.apache.http.client.methods.CloseableHttpResponse; 5 impor... 阅读全文
posted @ 2016-04-27 13:41 TestJ 阅读(3534) 评论(0) 推荐(0)