Package org.jboss.resteasy.spi
Interface HttpRequest
- All Known Implementing Classes:
BaseHttpRequest,DelegatingHttpRequest,HttpServerRequest,HttpServletInputMessage,MockHttpRequest,NettyHttpRequest,PrefixedFormFieldsHttpRequest,Servlet3AsyncHttpRequest,VertxHttpRequest
public interface HttpRequest
Bridge interface between the base Resteasy JAX-RS implementation and the actual HTTP transport (i.e. a servlet container)
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWere form parameters read before marshalling to body?voidgetAttribute(String attribute) Map of contextual data.default Optional<jakarta.ws.rs.core.EntityPart> getFormEntityPart(String name) Returns the optional entity part for amultipart/form-datarequest.default List<jakarta.ws.rs.core.EntityPart> Returns for entity parts for amultipart/form-datarequest.application/x-www-form-urlencoded parametersjakarta.ws.rs.core.HttpHeadersReturns the Internet Protocol (IP) address of the client or last proxy that sent the request.Returns the fully qualified name of the client or the last proxy that sent the request.jakarta.ws.rs.core.UriInfogetUri()This method *MUST* always return the same instance.booleanvoidremoveAttribute(String name) voidsetAttribute(String name, Object value) voidsetHttpMethod(String method) voidsetInputStream(InputStream stream) If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream().voidsetRequestUri(URI requestUri) Updates the object returned bygetUri().voidsetRequestUri(URI baseUri, URI requestUri) Updates the object returned bygetUri().boolean
-
Method Details
-
getHttpHeaders
jakarta.ws.rs.core.HttpHeaders getHttpHeaders() -
getMutableHeaders
-
getInputStream
InputStream getInputStream() -
setInputStream
If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream(). It will only override it for the resteasy HttpRequest- Parameters:
stream- input stream
-
getUri
jakarta.ws.rs.core.UriInfo getUri()This method *MUST* always return the same instance.- Returns:
- uri info
-
getHttpMethod
String getHttpMethod() -
setHttpMethod
-
setRequestUri
Updates the object returned bygetUri().- Parameters:
requestUri- request uri- Throws:
IllegalStateException
-
setRequestUri
Updates the object returned bygetUri().- Parameters:
baseUri- base urirequestUri- request uri- Throws:
IllegalStateException
-
getFormParameters
application/x-www-form-urlencoded parametersThis is here because @FormParam needs it and for when there are servlet filters that eat up the input stream
- Returns:
- null if no parameters, this is encoded map
-
getDecodedFormParameters
-
getFormEntityParts
Returns for entity parts for amultipart/form-datarequest.- Returns:
- the entity parts or an empty list
-
getFormEntityPart
Returns the optional entity part for amultipart/form-datarequest.- Parameters:
name- the name of the entity part- Returns:
- an optional entity part for the name
-
formParametersRead
boolean formParametersRead()Were form parameters read before marshalling to body?- Returns:
-
getAttribute
Map of contextual data. Similar to HttpServletRequest attributes- Parameters:
attribute- attribute name- Returns:
- attribute
-
setAttribute
-
removeAttribute
-
getAttributeNames
Enumeration<String> getAttributeNames() -
getAsyncContext
ResteasyAsynchronousContext getAsyncContext() -
isInitial
boolean isInitial() -
forward
-
wasForwarded
boolean wasForwarded() -
getRemoteAddress
String getRemoteAddress()Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.- Returns:
- a
Stringcontaining the IP address of the client that sent the request
-
getRemoteHost
String getRemoteHost()Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address.- Returns:
- a
Stringcontaining the fully qualified name of the client
-