vendredi 13 mars 2015

restTemplate.postForLocation returns null

I have wrote following code:



MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>();
map.add("secret", "SECRET_GOOGLE_KEY");
map.add("response", recapchaResponse);
restTemplate.postForLocation("http://ift.tt/1AMIfbj", map, ReCaptchaResponse.class);


last row returns null.


But when I send following response using POstman - I always see result: enter image description here


What do I wrong?


P.S.



class ReCaptchaResponse{
private String succes;
private String [] errorCodes;

public String[] getErrorCodes() {
return errorCodes;
}

public void setErrorCodes(String[] errorCodes) {
this.errorCodes = errorCodes;
}

public String getSucces() {
return succes;
}

public void setSucces(String succes) {
this.succes = succes;
}
}

Aucun commentaire:

Enregistrer un commentaire