"java.net.urlencoder.encode(string) is deprecated, what should i use instead?" Code Answer

4

use the other encode method in urlencoder:

urlencoder.encode(string, string)

the first parameter is the text to encode; the second is the name of the character encoding to use (e.g., utf-8). for example:

system.out.println(
  urlencoder.encode(
    "urlparameterstring",
    java.nio.charset.standardcharsets.utf_8.tostring()
  )
);
By Nithin Kumar Biliya on August 27 2022

Answers related to “java.net.urlencoder.encode(string) is deprecated, what should i use instead?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.