After upgrading to Apache HttpClient >=4.2, I found the following constant now deprecated:
org.apache.http.protocol.HTTP.UTF_8
Why was this constant deprecated (along with others) and what is the Apache HttpClient recommended alternative? The a HttpCore javadoc here lists it as deprecated but does not recommend an alternative.
Since Java 7, Java provides the StandardCharsets
class for getting the Charset
object for a few standard character sets. These are: ASCII, ISO-8859-1, UTF-8, UTF-16, UTF-16BE, and UTF-16LE. That's the alternative.
There's no longer a point in re-declaring the String
name of the character set in an HTTP
class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With