Modifier | Constructor and Description |
---|---|
protected |
AbstractApi(org.apache.http.client.HttpClient client,
String host,
String apiKey) |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
getById(String path,
String id,
Class<T> clazz)
GET a single resource by it's ID.
|
protected <T> List<T> |
getForAll(String path,
Class<T> clazz)
Collect all pages of a particular resources using a GET.
|
protected String |
post(String path,
Object body)
POST a resource.
|
protected <T> List<T> |
postForAll(String path,
Class<T> clazz,
Object body)
Collect all pages of a particular resources using a POST with body.
|
protected void |
put(String path,
Object body)
PUT a resource.
|
protected String post(String path, Object body)
path
- The path to post to.body
- The body to send in the post.protected void put(String path, Object body)
path
- The path to put to.body
- The body to send in the put.protected <T> T getById(String path, String id, Class<T> clazz)
path
- The path to the resource, including it's ID.id
- The ID of the resource.clazz
- The class to map response content to.protected <T> List<T> getForAll(String path, Class<T> clazz)
path
- The path to the resources.clazz
- The class to map the pages data to.protected <T> List<T> postForAll(String path, Class<T> clazz, Object body)
path
- The path to the resources.clazz
- The class to map the pages data to.body
- The body to send in each requestCopyright © 2016–2023. All rights reserved.