1、使用restTempleate发送带token的请求
//定义需要发送的参数
Map<String,String> parameterMap=new hashMap();
String token="*********************************";
HttpHeaders headers=new HttpHeaders();
headers.set("authorization",token)
MediaType type=MediaType.parse("Application/json; charset=UTF-8");
headers.setContentType(type);
//该集合用于存所需要发送的参数,也可用具体的对象
Map<String, String> dataMap= new HashMap<>();
HttpEntity<Map<String,String>> entity=new HttpEntity<>(dataMap,headers);
RestTempleate restTemplate=new ResTempleate();
ResponseEntity<Boolean> responseEntity = restTemplate.exchange(customProperties.getServiceShpUrl() + "/delete/table", HttpMethod.POST, entity, boolean.class);
//String response=restTemplate.postForEntity("url",entity,"返回值类型String.class");
//获取响应体中的内容
String body=response.getBody();