Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

confluence rest api response json to java entity

shenghong yao May 3, 2017

String auth = Base64.getEncoder().encodeToString("admin:admin".getBytes()); CloseableHttpClient httpClient = HttpClients.createDefault();

HttpGet httpGet = new HttpGet("http://localhost:8090/rest/api/content/688131"); httpGet.addHeader("Authorization", "Basic " + auth);

CloseableHttpResponse response = httpClient.execute(httpGet);

HttpEntity entity = response.getEntity();

String strResult = EntityUtils.toString(entity);

ObjectMapper mapper = new ObjectMapper();

//JsonContentProperty content = mapper.readValue(strResult, JsonContentProperty.class);

Content content = mapper.readValue(strResult, Content.class);

Above code is not work because com.atlassian.confluence.api.model.content.Content is not match. Which entity is match? Should I have to customize the entity?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events