public final class RestUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.apache.http.client.methods.CloseableHttpResponse |
del(String url,
org.apache.http.Header[] headers)
Envia comando DEL
|
static org.apache.http.client.methods.CloseableHttpResponse |
enviaComando(org.apache.http.client.methods.HttpUriRequest request)
Envia Comando
|
static org.apache.http.client.methods.CloseableHttpResponse |
enviaComandoCertificado(org.apache.http.client.methods.HttpUriRequest request,
String caminhoCertificado,
String senha)
Envia Comando
|
static org.apache.http.client.methods.CloseableHttpResponse |
get(String url,
org.apache.http.Header[] headers)
Envia comando GET
|
static <T> T |
JsonToObject(String json,
Class<T> clazz)
Converte o String Json para Objeto
|
static String |
ObjectToJson(Object objeto)
Converte o objeto para String Json
|
static org.apache.http.client.methods.CloseableHttpResponse |
post(String url,
org.apache.http.Header[] headers,
String json)
Envia comando POST
|
static org.apache.http.client.methods.CloseableHttpResponse |
post(String url,
org.apache.http.Header[] headers,
String json,
String caminhoCertificado,
String senhaCertificado)
Envia comando POST
|
static org.apache.http.client.methods.CloseableHttpResponse |
put(String url,
org.apache.http.Header[] headers,
String json)
Envia comando PUT
|
static String |
validaResponseERetornaBody(org.apache.http.client.methods.CloseableHttpResponse response)
Valida a response
|
public static org.apache.http.client.methods.CloseableHttpResponse post(String url, org.apache.http.Header[] headers, String json)
url - headers - json - public static org.apache.http.client.methods.CloseableHttpResponse post(String url, org.apache.http.Header[] headers, String json, String caminhoCertificado, String senhaCertificado)
url - headers - json - public static org.apache.http.client.methods.CloseableHttpResponse put(String url, org.apache.http.Header[] headers, String json)
url - headers - json - public static org.apache.http.client.methods.CloseableHttpResponse get(String url, org.apache.http.Header[] headers)
url - headers - public static org.apache.http.client.methods.CloseableHttpResponse del(String url, org.apache.http.Header[] headers)
url - headers - public static org.apache.http.client.methods.CloseableHttpResponse enviaComando(org.apache.http.client.methods.HttpUriRequest request)
request - Recebe o comando Get,Put,Post ou Delpublic static org.apache.http.client.methods.CloseableHttpResponse enviaComandoCertificado(org.apache.http.client.methods.HttpUriRequest request,
String caminhoCertificado,
String senha)
request - Recebe o comando Get,Put,Post ou Delpublic static String validaResponseERetornaBody(org.apache.http.client.methods.CloseableHttpResponse response) throws IOException
response - IOExceptionpublic static String ObjectToJson(Object objeto) throws com.fasterxml.jackson.core.JsonProcessingException
objeto - com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <T> T JsonToObject(String json, Class<T> clazz) throws IOException
objeto - com.fasterxml.jackson.core.JsonProcessingExceptionIOExceptionCopyright © 2022. All rights reserved.