Package com.io7m.idstore.server.http
Class IdHTTPServerRequests
java.lang.Object
com.io7m.idstore.server.http.IdHTTPServerRequests
Functions over server requests.
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
contentLength
(io.helidon.webserver.http.ServerRequest request) Obtain the content length for the given request, or -1 if none exists.static String
Obtain the value of the given query parameter.parameterOrEmpty
(io.helidon.webserver.http.ServerRequest request, String name) Obtain the value of the given query parameter.static String
remoteAddress
(io.helidon.webserver.http.ServerRequest request) Obtain the remote address for the given request.static String
userAgent
(io.helidon.webserver.http.ServerRequest request) Obtain the user agent for the given request, or the empty string if none exists.
-
Method Details
-
contentLength
public static long contentLength(io.helidon.webserver.http.ServerRequest request) Obtain the content length for the given request, or -1 if none exists.- Parameters:
request
- The request- Returns:
- The content length
-
userAgent
Obtain the user agent for the given request, or the empty string if none exists.- Parameters:
request
- The request- Returns:
- The user agent
-
remoteAddress
Obtain the remote address for the given request. The function takes into account headers such as "X-Forwarded-For".- Parameters:
request
- The request- Returns:
- The remote address
-
parameter
Obtain the value of the given query parameter.- Parameters:
request
- The requestname
- The parameter name- Returns:
- The parameter value (or null)
-
parameterOrEmpty
public static Optional<String> parameterOrEmpty(io.helidon.webserver.http.ServerRequest request, String name) Obtain the value of the given query parameter.- Parameters:
request
- The requestname
- The parameter name- Returns:
- The parameter value
-