java-使用RestTemplate-post方式提交表单数据

HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

MultiValueMap map= new LinkedMultiValueMap();
map.add("email", "[email protected]");

HttpEntity> request = new HttpEntity>(map, headers);

ResponseEntity response = restTemplate.postForEntity( url, request , String.class );

你可能感兴趣的:(java-使用RestTemplate-post方式提交表单数据)