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; }