restTemplate x-www-form-urlencoded

MultiValueMap postParameters = new LinkedMultiValueMap<>();
postParameters.add("mobile", phone);
postParameters.add("smsCaptcha", code);
postParameters.add("action", "unKnown");
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/x-www-form-urlencoded");
HttpEntity> r = new HttpEntity<>(postParameters, headers);
ResponseMessage responseMessage = restTemplate.postForObject(url, r, ResponseMessage.class);

你可能感兴趣的:(java,restTemplate)