AL-1801
parent
d55b35300c
commit
cc1e7bdccf
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue