Package org.rapidcontext.util
Class HttpUtil.Helper
java.lang.Object
org.rapidcontext.util.HttpUtil.Helper
- Enclosing interface:
HttpUtil
Some static utility methods for HTTP.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
browserInfo
(String userAgent) Returns the browser best matching the user agent string.static String
Decodes a URL from the URL encoding.static int
defaultPort
(String protocol) Returns the default port for a protocol.static String
Encodes a URL with proper URL encoding.
-
Method Details
-
defaultPort
Returns the default port for a protocol.- Parameters:
protocol
- the protocol name (HTTP/HTTPS)- Returns:
- the default HTTP or HTTPS port number
-
browserInfo
Returns the browser best matching the user agent string.- Parameters:
userAgent
- the request User-Agent header- Returns:
- the browser info matching the user agent, or null for no match
-
encodeUrl
Encodes a URL with proper URL encoding.- Parameters:
href
- the URL to encode- Returns:
- the encoded URL
-
decodeUrl
Decodes a URL from the URL encoding.- Parameters:
href
- the URL to decode- Returns:
- the decoded URL
-