Class ApiUtil


  • public class ApiUtil
    extends Object
    The RestUtil class provides utility methods that are useful when working with APIs implemented as RESTful web services.
    Author:
    Marcus Portmann
    • Constructor Detail

      • ApiUtil

        public ApiUtil()
    • Method Detail

      • quote

        public static String quote​(String string)
        Produce a string in double quotes with backslash sequences in all the right places. A backslash will be inserted within </, producing <\/, allowing JSON text to be delivered in HTML. In JSON text, a string cannot contain a control character or an unescaped quote or backslash.
        Parameters:
        string - a String
        Returns:
        a String correctly formatted for insertion in a JSON text