Class KiwiHttpResponses2

java.lang.Object
org.kiwiproject.beta.net.KiwiHttpResponses2

@Beta public final class KiwiHttpResponses2 extends Object
Utilities related to HTTP responses.

Some of these methods may eventually be moved into org.kiwiproject.net.KiwiHttpResponses in kiwi.

  • Method Details

    • htmlEscape

      public static String htmlEscape(String entity, String mediaType)
      If the mediaType is HTML (text/html), return the escaped entity. Otherwise, return entity without modification.
      Parameters:
      entity - the response entity
      mediaType - the media type to evaluate
      Returns:
      the HTML-escaped entity if the response is HTML, otherwise the original entity
      Throws:
      IllegalArgumentException - if entity is null or mediaType is blank
      See Also:
      • HtmlEscapers