From 8ddf1969b326f4a094553a2d9060a3223982bd60 Mon Sep 17 00:00:00 2001 From: B3ret <7371857+B3ret@users.noreply.github.com> Date: Tue, 12 May 2020 16:41:01 +0200 Subject: [PATCH] Use encoding for json as well I have to send UTF-8 strings via Json (e.g., for Umlauts) and need the encoding in the StringEntity! (1) Maybe this also has to be applied to PutRequest (2) Maybe the encoding should also be added to the header. --- src/http/requests/PostRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/requests/PostRequest.java b/src/http/requests/PostRequest.java index ce23198..2d773d0 100644 --- a/src/http/requests/PostRequest.java +++ b/src/http/requests/PostRequest.java @@ -71,7 +71,7 @@ public void addData(String key, String value) public void addData(String json) { try{ - stringEntity = new StringEntity(json); + stringEntity = new StringEntity(json, encoding); } catch( Exception e ) { e.printStackTrace(); }