Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 0877867

Browse files
authored
Merge pull request #152 from ucal/feature/issue-150-get-json-as-admin
Feature/issue 150 add getJsonAsAdmin() in ManageClient class
2 parents a2fb76d + 6cf7646 commit 0877867

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/marklogic/mgmt/ManageClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ public String getJson(URI uri) {
144144
return getRestTemplate().exchange(uri, HttpMethod.GET, new HttpEntity<>(headers), String.class).getBody();
145145
}
146146

147+
public String getJsonAsAdmin(String path) {
148+
logAdminRequest(path, "JSON", "GET");
149+
HttpHeaders headers = new HttpHeaders();
150+
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
151+
return getAdminRestTemplate().exchange(buildUri(path), HttpMethod.GET, new HttpEntity<>(headers), String.class)
152+
.getBody();
153+
}
154+
147155
public void delete(String path) {
148156
logRequest(path, "", "DELETE");
149157
restTemplate.delete(buildUri(path));

0 commit comments

Comments
 (0)