Я хочу сделать postForEntity
, но результат всегда будет нулевым. В чем может быть причина?
@Override
public ResponseEntity<Void> updateContactProperty(final Long contactId, final String json) throws RestClientException {
ResponseEntity<Void> crmResponse = null;
try {
crmResponse = crmRestTemplate.postForEntity(
"https://api.hubapi.com/contacts/v1/contact/vid/400000001/profile?hapikey=myApiKey", json, Void.class);
} catch (HttpClientErrorException e) {
e.printStackTrace();
} catch (HttpStatusCodeException e) {
e.printStackTrace();
}catch (RestClientException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} catch (Error r) {
r.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
}
return crmResponse;
}
Я пробовал ResponseEntity<Void>
, ResponseEntity<Object>
, ResponseEntity<String>
.
Конвертеры сообщений, зарегистрированные с помощью RestTemplate:
- ByteArrayHttpMessageConverter
- StringHttpMessageConverter
- ResourceHttpMessageConverter
- SourceConververHessterPhttp:
- Jaxb2RootElementHttpMessageConverter
- MappingJackson2HttpMessageConverter
Никаких исключений не может быть поймано ... вызов только что выполнен, но ничего не происходит.