HttpClient???????????????????????
???????????? ???????[ 2015/9/6 9:34:48 ] ???????????????
????2?? ???excel???
????A???????????????????
??????F12????chrome???????excel????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
???????post?????????????org.apache.httpcomponents??httpmime jar??????Maven?м?????????
????<dependency>
????<groupId>org.apache.httpcomponents</groupId>
????<artifactId>httpmime</artifactId>
????<version>4.5</version>
????</dependency>
?????????????????
????HttpPost httpPost = new HttpPost(url);
????FileBody file = new FileBody(new File(GlobalSetting.getResoucesPath()+fileName));
????HttpEntity reqEntity = MultipartEntityBuilder.create()
????.addPart("myfile"?? file)
????.build();
????httpPost.setEntity(reqEntity);
????CloseableHttpResponse response = httpclient.execute(httpPost);
???????У?fileName?“?????????????????壨????.xlsx”?????????FileBody??????????????MultipartEntityBuilder??????HttpEntity?С?
????B???????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
?????????????????
????HttpPost httpPost = new HttpPost(url);
????FileBody file = new FileBody(new File(GlobalSetting.getResoucesPath()+fileName));
????StringBody id = new StringBody(PoId??Charset.forName("UTF-8"));
????HttpEntity reqEntity = MultipartEntityBuilder.create()
????.addPart("scheduleId"?? id)
????.addPart("myfile"?? file)
????.build();
????httpPost.setEntity(reqEntity);
????CloseableHttpResponse response = httpclient.execute(httpPost);
???????У?fileName?“??????????????????.xlsx”??PoId?“1033046”?????????FileBody??StringBody????????????MultipartEntityBuilder??????HttpEntity?С?
????3?? POST??????????????
????????????post?????????ж???????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
???????JSON????List <NameValuePair> nvps = new ArrayList <NameValuePair>()????????
?????????????JSON????
????JSONObject postEntityJSON= new JSONObject();
????postEntityJSON.put("curSupplierAreaId"??"0");
????postEntityJSON.put("endDate"??"1444924799000");
????postEntityJSON.put("limit"??"10");
????postEntityJSON.put("offset"??"0");
????postEntityJSON.put("startDate"??"1410710400000");
????postEntityJSON.put("status"??"0");
??????????????????????????????????????????????
????HttpClient ??????????????????????? - ?????? - dreamsyeah
?????????????????
????HttpPost post = new HttpPost(url);
????post.setHeader("Accept"?? "application/json");
????post.setHeader("Content-Type"?? "application/json");
????post.setEntity(new StringEntity("["+PoId+"]"));
????CloseableHttpResponse response = httpclient.execute(post);
???????У?PoId?“1033046”????????????????????????????Σ??????????????????????????????????????post????弴??????
????4?? ???excel???????
?????????????????????excel??????????????excel????????????鷳???????????java??????????excel????????????????Ч???
?????????maven????????????????????
????<dependency>
????<groupId>org.apache.poi</groupId>
????<artifactId>poi</artifactId>
????<version>3.9</version>
????</dependency>
????<dependency>
????<groupId>org.apache.poi</groupId>
????<artifactId>poi-ooxml</artifactId>
????<version>3.9</version>
????</dependency>
????????poi??????.xls??excel?????poi-ooxml??????.xlsx??excel?????
???????в???????????????
try
{
FileInputStream
file = new FileInputStream(new File(GlobalSetting.getResoucesPath()+excelName));
XSSFWorkbook workbook = new XSSFWorkbook(file);
XSSFSheet sheet = workbook.getSheetAt(0);
int rowNum = sheet.getLastRowNum();
XSSFRow row = sheet.getRow(0);
int index = 0;
for (int i = 2; i <= rowNum; i++) {
row = sheet.getRow(i);
row.getCell(3).setCellValue(list.get(index++));
}
FileOutputStream out = new FileOutputStream(new
File(GlobalSetting.getResoucesPath()+excelName));
workbook.write(out);
file.close();
out.close();
} catch (Exception e){
e.printStackTrace();
}
????5?? ??????
?????????????????????ZIP??????????????????????????????????????????????????в???????鷳????????java?????????????????
????Java????????zip?????API?????import java.util.zip.*;
????????????????????????????????????????????????????????????????????????????????zip???????????????????????????????洢???????????????ZIP?????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??????????????????????????Щ?????????????????????????????ν???????????????α???????????????????300??Python?????????y??????????????????????????????y????????y????????????????????????淨(jìng)???????????????????????????????????????????????????????????Python?????????????????????????????????????????????post??????????????????Python+PyCharm????????????????diff???????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????