Class HttpUtil

java.lang.Object
jodd.http.HttpUtil

public class HttpUtil extends Object
Few HTTP utilities.
  • Constructor Details

    • HttpUtil

      public HttpUtil()
  • Method Details

    • buildQuery

      public static String buildQuery(HttpMultiMap<?> queryMap, String encoding)
      Builds a query string from given query map.
    • parseQuery

      public static HttpMultiMap<String> parseQuery(String query, boolean decode)
      Parses query from give query string. Values are optionally decoded.
    • prepareHeaderParameterName

      public static String prepareHeaderParameterName(String headerName)
      Makes nice header names.
    • extractMediaType

      public static String extractMediaType(String contentType)
      Extracts media-type from value of "Content Type" header.
    • extractContentTypeCharset

      public static String extractContentTypeCharset(String contentType)
      See Also:
    • extractKeepAliveTimeout

      public static String extractKeepAliveTimeout(String keepAlive)
      Extract keep-alive timeout.
    • extractKeepAliveMax

      public static String extractKeepAliveMax(String keepAlive)
    • extractHeaderParameter

      public static String extractHeaderParameter(String header, String parameter, char separator)
      Extracts header parameter. Returns null if parameter not found.
    • isAbsoluteUrl

      public static boolean isAbsoluteUrl(String url)
      Determines if path is relative or absolute. https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 A relative reference that begins with a single slash character is termed an absolute-path reference. A relative reference that does not begin with a slash character is termed a relative-path reference. A path segment that contains a colon character (e.g., "this:that") cannot be used as the first segment of a relative-path reference, as it would be mistaken for a scheme name.