Skip to content

Commit

Permalink
docs(java): update samples and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
renal31 committed Dec 13, 2023
1 parent 6dc9a20 commit f8de6af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.charset.UnsupportedCharsetException;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
Expand Down Expand Up @@ -703,7 +704,7 @@ public HttpEntity serialize(Object obj, Map<String, Object> formParams, ContentT
String mimeType = contentType.getMimeType();
if (isJsonMime(mimeType)) {
try {
return new StringEntity(objectMapper.writeValueAsString(obj), contentType);
return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8));
} catch (JsonProcessingException e) {
throw new ApiException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.charset.UnsupportedCharsetException;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
Expand Down Expand Up @@ -796,7 +797,7 @@ public HttpEntity serialize(Object obj, Map<String, Object> formParams, ContentT
String mimeType = contentType.getMimeType();
if (isJsonMime(mimeType)) {
try {
return new StringEntity(objectMapper.writeValueAsString(obj), contentType);
return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8));
} catch (JsonProcessingException e) {
throw new ApiException(e);
}
Expand Down

0 comments on commit f8de6af

Please sign in to comment.