public class ZinvoiceHttpClient extends java.lang.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(java.lang.String endpoint)
Runs DELETE request.
|
java.io.InputStream |
download(java.lang.String endpoint)
Downloads content as
InputStream . |
<T> T |
get(java.lang.String endpoint,
java.lang.Class<T> responseTypeClass)
Runs GET request.
|
<T> T |
post(java.lang.String endpoint,
byte[] body,
java.lang.String contentType,
java.lang.Class<T> responseTypeClass)
Runs POST request.
|
<T> T |
put(java.lang.String endpoint,
byte[] body,
java.lang.String contentType,
java.lang.Class<T> responseTypeClass)
Runs PUT request.
|
<T> T |
upload(java.lang.String endpoint,
java.util.Map<java.lang.String,java.io.InputStream> files,
java.lang.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 void delete(java.lang.String endpoint)
Runs DELETE request.
endpoint
- public java.io.InputStream download(java.lang.String endpoint)
Downloads content as InputStream
.
endpoint
- public <T> T get(java.lang.String endpoint, java.lang.Class<T> responseTypeClass)
Runs GET request.
endpoint
- responseTypeClass
- public <T> T post(java.lang.String endpoint, byte[] body, java.lang.String contentType, java.lang.Class<T> responseTypeClass)
Runs POST request.
endpoint
- body
- contentType
- responseTypeClass
- public <T> T put(java.lang.String endpoint, byte[] body, java.lang.String contentType, java.lang.Class<T> responseTypeClass)
Runs PUT request.
endpoint
- body
- contentType
- responseTypeClass
- public <T> T upload(java.lang.String endpoint, java.util.Map<java.lang.String,java.io.InputStream> files, java.lang.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-2018 Konik.io. All Rights Reserved.