public class HttpUtil
extends java.lang.Object
HttpRequest and related objects.| Constructor and Description |
|---|
HttpUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getHostAndPortFromRequest(io.netty.handler.codec.http.HttpRequest httpRequest)
Gets the host and port from the specified request.
|
static java.lang.String |
getHostAndPortFromUri(java.lang.String uriString)
Retrieves the host and port from the specified URI.
|
static java.lang.String |
getHostFromRequest(io.netty.handler.codec.http.HttpRequest httpRequest)
Identify the host of an HTTP request.
|
static boolean |
startsWithHttpOrHttps(java.lang.String uri)
Returns true if the string starts with http:// or https://.
|
public static java.lang.String getHostFromRequest(io.netty.handler.codec.http.HttpRequest httpRequest)
httpRequest - HTTP request to parse the host frompublic static java.lang.String getHostAndPortFromRequest(io.netty.handler.codec.http.HttpRequest httpRequest)
httpRequest - HTTP requestpublic static boolean startsWithHttpOrHttps(java.lang.String uri)
uri - string to evaluatepublic static java.lang.String getHostAndPortFromUri(java.lang.String uriString)
throws java.net.URISyntaxException
uriString - URI to retrieve the host and port fromjava.net.URISyntaxException - if the specified URI is invalid or cannot be parsed