基于springboot RestTemplate
// 设置header
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", "application/json, text/plain, */*");
headers.set("Accept-Language", "zh-CN,zh;q=0.9");
headers.set("Authorization", token);
headers.set("Connection", "keep-alive");
headers.set("Content-Type", "application/json");
headers.set("Origin", apiHost);
headers.set("Referer", apiHost + "/api/x3-service-bills-center/bills/sapreport/summary/query/report");
headers.set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36");
// 发送Json
String json = "{\n" + " \"sapBillsType\": null,\n" + " \"billsTypeName\": null,\n" + " \"sureDate\": [\n" + " \"" + s_date + "T00:00:00.000+0800\",\n" + " \"" + e_date + "T23:59:59.999+0800\"\n" + " ],\n" + " \"searchKey\": null,\n" + " \"setDepotModuleFilter\": null,\n" + " \"getDepotModuleFilter\": null,\n" + " \"pageSize\": " + pageSize + ",\n" + " \"pageIndex\": " + pageIndex + "\n" + "}";
System.out.println(json);
HttpEntity<String> request = new HttpEntity<String>(json, headers);
// 读取数据
String requestUrl = apiHost + "/api/x3-service-bills-center/bills/sapreport/summary/query/report";
SapReportSummaryResponse sapReportSummaryResponse = restTemplate.postForObject(requestUrl, request, SapReportSummaryResponse.class);
字节(Byte)是计量单位,表示数据量多少,是计算机信息技术用于计量存储容量的一种计量单位,通常情况下一字节等于八位。字符(Character)计算机中使用的字母、数字、字和符号,比如'A'、'B'、'$'、'&'等。一般在英文...
public class test { public static void main(String[] args) { &...
public class test { public static void main(String[] args) { &...
java限制1个方法同一时间只能被一个线程访问public synchronized void setOrderPay(){ }加上synchronized 修饰符即可...
(1).final 修饰符通常和 static 修饰符一起使用来创建类常量。(2).父类中的 final 方法可以被子类继承,但是不能被子类重写,声明 final 方法的主要目的是防止该方法的内容被修改。public class Member {  ...
(1).创建数组double[] myList = new double[size]; //推荐创建方式 double myList[] = new double[size];  ...