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