RestTemplate

RestTemplate restTemplate = new RestTemplate();

    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
    headers.set("hisId", "");
    headers.add("uname", "");
    headers.add("hosToken", "");

    HttpEntity> httpEntity = new HttpEntity<>(null, headers);

    Map paramMap = new HashMap<>();
    paramMap.put("data", data);

    ResponseEntity response = restTemplate.exchange(DoctorRecordAuthManager.HOST + DoctorRecordAuthManager.PATH_UPLOAD + "?data={data}", HttpMethod.POST, httpEntity, String.class, paramMap);

你可能感兴趣的:(RestTemplate)