public class ZinvoiceHttpClient extends Object
HTTP client for Zinvoice services.
It allows to call Zinvoice endpoints with no worries about internal connection details.
| Modifier and Type | Field and Description |
|---|---|
static com.google.api.client.http.HttpRequestFactory |
DEFAULT_HTTP_REQUEST_FACTORY |
| Constructor and Description |
|---|
ZinvoiceHttpClient(ZinvoiceApiConfig apiConfig) |
ZinvoiceHttpClient(ZinvoiceApiConfig apiConfig,
com.google.api.client.http.HttpRequestFactory httpRequestFactory,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
ZinvoiceHttpClient(ZinvoiceApiConfig apiConfig,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(String endpoint)
Runs DELETE request.
|
InputStream |
download(String endpoint)
Downloads content as
InputStream. |
<T> T |
get(String endpoint,
Class<T> responseTypeClass)
Runs GET request.
|
<T> T |
post(String endpoint,
byte[] body,
String contentType,
Class<T> responseTypeClass)
Runs POST request.
|
<T> T |
put(String endpoint,
byte[] body,
String contentType,
Class<T> responseTypeClass)
Runs PUT request.
|
<T> T |
upload(String endpoint,
Map<String,InputStream> files,
Class<T> responseTypeClass)
Uploads
InputStream to given endpoint. |
public static final com.google.api.client.http.HttpRequestFactory DEFAULT_HTTP_REQUEST_FACTORY
public ZinvoiceHttpClient(ZinvoiceApiConfig apiConfig)
public ZinvoiceHttpClient(ZinvoiceApiConfig apiConfig, com.google.api.client.http.HttpRequestFactory httpRequestFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public ZinvoiceHttpClient(ZinvoiceApiConfig apiConfig, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public InputStream download(String endpoint)
Downloads content as InputStream.
endpoint - public <T> T get(String endpoint, Class<T> responseTypeClass)
Runs GET request.
endpoint - responseTypeClass - public <T> T post(String endpoint, byte[] body, String contentType, Class<T> responseTypeClass)
Runs POST request.
endpoint - body - contentType - responseTypeClass - public <T> T put(String endpoint, byte[] body, String contentType, Class<T> responseTypeClass)
Runs PUT request.
endpoint - body - contentType - responseTypeClass - public <T> T upload(String endpoint, Map<String,InputStream> files, Class<T> responseTypeClass)
Uploads InputStream to given endpoint.
endpoint - files - map where key is field name and value is a content of uploading fileresponseTypeClass - Copyright © 2014-2016 Konik.io. All Rights Reserved.