Package dev.voidframework.web.server
Class UndertowRequest
java.lang.Object
dev.voidframework.web.server.UndertowRequest
- All Implemented Interfaces:
HttpRequest
Undertow
HttpRequest implementation.-
Constructor Summary
ConstructorsConstructorDescriptionUndertowRequest(io.undertow.server.HttpServerExchange httpServerExchange, HttpRequestBodyContent httpRequestBodyContent) Build a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptContentType(String contentType) Checks if the current request accept a specific content type.Returns the body content;Returns the request charset.Returns a cookie.Returns a single header.Returns all headers.Get the HTTP request method.Get the input stream to read the request.Returns the query string, without the leading "?".getQueryStringParameter(String parameterName) Returns the query string parameter value.Returns all query string parameters.Returns the remote host that this request was sent to.Returns the original request URI.Returns the complete URL as seen by the user.
-
Constructor Details
-
UndertowRequest
public UndertowRequest(io.undertow.server.HttpServerExchange httpServerExchange, HttpRequestBodyContent httpRequestBodyContent) Build a new instance.- Parameters:
httpServerExchange- Current Http server exchangehttpRequestBodyContent- Current Http request body content
-
-
Method Details
-
getCharset
Description copied from interface:HttpRequestReturns the request charset.- Specified by:
getCharsetin interfaceHttpRequest- Returns:
- The request charset
-
getCookie
Description copied from interface:HttpRequestReturns a cookie.- Specified by:
getCookiein interfaceHttpRequest- Parameters:
cookieName- The cookie name- Returns:
- The cookie, otherwise, null
-
acceptContentType
Description copied from interface:HttpRequestChecks if the current request accept a specific content type.- Specified by:
acceptContentTypein interfaceHttpRequest- Parameters:
contentType- The content type- Returns:
trueif the content type is accepted, otherwise,false
-
getHeader
Description copied from interface:HttpRequestReturns a single header.- Specified by:
getHeaderin interfaceHttpRequest- Parameters:
headerName- The header name- Returns:
- The requested header value, otherwise, a null value
-
getHeaders
Description copied from interface:HttpRequestReturns all headers.- Specified by:
getHeadersin interfaceHttpRequest- Returns:
- All headers
-
getHttpMethod
Description copied from interface:HttpRequestGet the HTTP request method.- Specified by:
getHttpMethodin interfaceHttpRequest- Returns:
- The request method
-
getInputSteam
Description copied from interface:HttpRequestGet the input stream to read the request. Can only be called one time.- Specified by:
getInputSteamin interfaceHttpRequest- Returns:
- The input stream
-
getQueryString
Description copied from interface:HttpRequestReturns the query string, without the leading "?".- Specified by:
getQueryStringin interfaceHttpRequest- Returns:
- The query string
-
getQueryStringParameter
Description copied from interface:HttpRequestReturns the query string parameter value.- Specified by:
getQueryStringParameterin interfaceHttpRequest- Parameters:
parameterName- The parameter name- Returns:
- The query string parameter value
-
getQueryStringParameters
Description copied from interface:HttpRequestReturns all query string parameters.- Specified by:
getQueryStringParametersin interfaceHttpRequest- Returns:
- All query string parameters
-
getRemoteHostName
Description copied from interface:HttpRequestReturns the remote host that this request was sent to.- Specified by:
getRemoteHostNamein interfaceHttpRequest- Returns:
- The remote host name
-
getRequestURL
Description copied from interface:HttpRequestReturns the complete URL as seen by the user.- Specified by:
getRequestURLin interfaceHttpRequest- Returns:
- The request URL
-
getRequestURI
Description copied from interface:HttpRequestReturns the original request URI. This is not decoded in any way, and does not include the query string.- Specified by:
getRequestURIin interfaceHttpRequest- Returns:
- The request URI
-
getBodyContent
Description copied from interface:HttpRequestReturns the body content;- Specified by:
getBodyContentin interfaceHttpRequest- Returns:
- The body content
-