public class ApacheHttpClient extends java.lang.Object implements TrelloHttpClient
| Constructor and Description |
|---|
ApacheHttpClient() |
ApacheHttpClient(org.apache.http.client.HttpClient httpClient) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
delete(java.lang.String url,
java.lang.Class<T> responseType,
java.lang.String... params)
Performs HTTP
DELETE request and converts response. |
<T> T |
get(java.lang.String url,
java.lang.Class<T> responseType,
java.lang.String... params)
Performs HTTP
GET request and converts response. |
<T> T |
postFileForObject(java.lang.String url,
java.io.File file,
java.lang.Class<T> objectClass,
java.lang.String... params)
Performs HTTP
POST request and converts response. |
java.net.URI |
postForLocation(java.lang.String url,
java.lang.Object body,
java.lang.String... params)
Performs HTTP
POST request and returns the value of the Location header. |
<T> T |
postForObject(java.lang.String url,
java.lang.Object body,
java.lang.Class<T> responseType,
java.lang.String... params)
Performs HTTP
POST request and converts response. |
<T> T |
putForObject(java.lang.String url,
java.lang.Object body,
java.lang.Class<T> responseType,
java.lang.String... params)
Performs HTTP
PUT request and converts response. |
public ApacheHttpClient()
public ApacheHttpClient(org.apache.http.client.HttpClient httpClient)
public <T> T get(java.lang.String url,
java.lang.Class<T> responseType,
java.lang.String... params)
TrelloHttpClientGET request and converts response.
The template variables in url are expanded using the given params, if any.
get in interface TrelloHttpClientT - The response object type.url - The URL to make request to.responseType - The response object class object.params - The URL query part or path parameters that should be expanded.public <T> T postForObject(java.lang.String url,
java.lang.Object body,
java.lang.Class<T> responseType,
java.lang.String... params)
TrelloHttpClientPOST request and converts response.
The template variables in url are expanded using the given params, if any.
postForObject in interface TrelloHttpClientT - The response object type.url - The URL to make request to.body - The object to be converted to its JSON representation and POSTed. Use null to send request with empty body.responseType - The response object class object.params - The URL query part or path parameters that should be expanded.public <T> T postFileForObject(java.lang.String url,
java.io.File file,
java.lang.Class<T> objectClass,
java.lang.String... params)
TrelloHttpClientPOST request and converts response. The file should be transmitted using multipart/form-data.
This is optional method.
The template variables in url are expanded using the given params, if any.
postFileForObject in interface TrelloHttpClientT - The response object type.url - The URL to make request to.file - The file to upload.objectClass - The response object class object.params - The URL query part or path parameters that should be expanded.public <T> T putForObject(java.lang.String url,
java.lang.Object body,
java.lang.Class<T> responseType,
java.lang.String... params)
TrelloHttpClientPUT request and converts response.
The template variables in url are expanded using the given params, if any.
putForObject in interface TrelloHttpClientT - The response object type.url - The URL to make request to.body - The object to be converted to its JSON representation and POSTed. Use null send request with empty body.responseType - The response object class object.params - The URL query part or path parameters that should be expanded.public <T> T delete(java.lang.String url,
java.lang.Class<T> responseType,
java.lang.String... params)
TrelloHttpClientDELETE request and converts response.
The template variables in url are expanded using the given params, if any.
delete in interface TrelloHttpClientT - The response object type.url - The URL to make request to.responseType - The response object class object.params - The URL query part or path parameters that should be expanded.public java.net.URI postForLocation(java.lang.String url,
java.lang.Object body,
java.lang.String... params)
TrelloHttpClientPOST request and returns the value of the Location header.
The template variables in url are expanded using the given params, if any.
postForLocation in interface TrelloHttpClienturl - The URL to make request to.body - The object to be converted to its JSON representation and POSTed. Use null
to send request with empty body.params - The URL query part or path parameters that should be expanded.POSTed resource location.