Hi,
I'm trying to create a page with a POST call using Spring's RestTemplate object. If I POST the following JSON via Postman, it works:
Using the following bit of Java, however, gives me a 400 Bad Request response:
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", "Basic " + authorization);
headers.set("Content-Type", "application/json");
ResponseEntity<Object> resp = restTemplate.exchange("https://xxxxxxx.atlassian.net/wiki/rest/api/content", HttpMethod.POST,
new HttpEntity<>(pageJson, headers), Object.class);
Here's the response message:
org.codehaus.jackson.map.JsonMappingException: Can not instantiate value of type [simple type, class com.atlassian.confluence.api.model.content.Content] from JSON String; no single-String constructor/factory method
What class should I be passing to the exchange call?? Is it the com.atlassian.confluence.api.model.content.Content class in the error message?? And if so, what's the Maven dependency that has this class?? I can't seem to find it anywhere.
Thanks,
-Larry