@Test public void testGet() throws Exception { assertNotNull(SimpleHttpRequester.getHttpRequester().get("http://www.baidu.com")); Map<String, String> paramsMap = new HashMap<>(); paramsMap.put("wd", "faljfdlasjflkjasdlfjlasjflkajflkdajslkfjsa"); assertNotNull(SimpleHttpRequester.getHttpRequester().get("http://www.baidu.com/s", paramsMap)); List<NameValuePair> paramsList = new ArrayList<>(); paramsList.add(new BasicNameValuePair("wd", "faljfdlasjflkjasdlfjlasjflkajflkdajslkfjsa")); assertNotNull(SimpleHttpRequester.getHttpRequester().get("http://www.baidu.com/s", paramsList)); }
@Test public void testPost() throws Exception { assertNotNull( SimpleHttpRequester.getHttpRequester() .post( "http://10.6.2.48:8042/pcm-inner-sdc/organization/selectShop.htm", "{\"itemCode\":40000100}")); }