From cc1e7bdccf6389617ef00a96230a3dfb8c626a36 Mon Sep 17 00:00:00 2001 From: "lucas.taia" Date: Wed, 22 Feb 2023 14:23:16 -0300 Subject: [PATCH] AL-1801 --- .../ventaboletos/rest/generic/GenericRest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/rjconsultores/ventaboletos/rest/generic/GenericRest.java b/src/com/rjconsultores/ventaboletos/rest/generic/GenericRest.java index f37e447bd..f18f7bbcd 100644 --- a/src/com/rjconsultores/ventaboletos/rest/generic/GenericRest.java +++ b/src/com/rjconsultores/ventaboletos/rest/generic/GenericRest.java @@ -108,7 +108,7 @@ public class GenericRest { private HttpUriRequest retornaRequestWithHeader(String uri, TipoEnvioRest metodo, String parametro, ContentType contentType, HashMap headers) throws Exception { HttpUriRequest request = new HttpPost(uri); - StringEntity body = new StringEntity(parametro != null ? parametro : ""); + StringEntity body = new StringEntity(parametro != null ? parametro : "", "UTF-8"); if (TipoEnvioRest.GET.equals(metodo)) { request = new HttpGet(parametro != null @@ -130,6 +130,10 @@ public class GenericRest { String value = entry.getValue(); request.addHeader(key, value); } + + if (headers != null && metodo != null) { + headers.put("Content-type", contentType.getMimeType()); + } return request; }