您可以尝试类似:
final String url = String.format("%s/api/shop/{id}", Global.webserviceUrl); RestTemplate restTemplate = new RestTemplate(); restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter()); HttpHeaders headers = new HttpHeaders(); headers.set("X-TP-DeviceID", Global.deviceID); Shop shop= new Shop(); Map<String, String> param = new HashMap<String, String>(); param.put("id","10") HttpEntity<Shop> requestEntity = new HttpEntity<Shop>(shop, headers); HttpEntity<Shop[]> response = restTemplate.exchange(url, HttpMethod.PUT, requestEntity, Shop[].class, param); shops = response.getBody();
认沽权无效,而交易所会给您答复,最好的检查地点是文档https://docs.spring.io/spring/docs/current/javadoc-
api/org/springframework/web/client/RestTemplate。
html
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)