Previously, the code used response.getBytes() which might rely on the platform's default charset to encode the HTTP response data, leading to inconsistent behavior across platforms. This commit updates the code to use response.getBytes(StandardCharsets.UTF_8), specifying UTF-8 encoding explicitly for processing response data. This ensures cross-platform consistency and avoids potential encoding issues.
Previously, the code used
response.getBytes()
which might rely on the platform's default charset to encode the HTTP response data, leading to inconsistent behavior across platforms. This commit updates the code to useresponse.getBytes(StandardCharsets.UTF_8)
, specifying UTF-8 encoding explicitly for processing response data. This ensures cross-platform consistency and avoids potential encoding issues.