master
lucas.taia 2023-02-22 14:23:16 -03:00
parent d55b35300c
commit cc1e7bdccf
1 changed files with 5 additions and 1 deletions

View File

@ -108,7 +108,7 @@ public class GenericRest {
private HttpUriRequest retornaRequestWithHeader(String uri, TipoEnvioRest metodo, String parametro,
ContentType contentType, HashMap<String, String> 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;
}