Package io.netty.handler.codec.http
Class DefaultHttpRequest
java.lang.Object
io.netty.handler.codec.http.DefaultHttpObject
io.netty.handler.codec.http.DefaultHttpMessage
io.netty.handler.codec.http.DefaultHttpRequest
- All Implemented Interfaces:
io.netty.handler.codec.DecoderResultProvider,HttpMessage,HttpObject,HttpRequest
- Direct Known Subclasses:
DefaultFullHttpRequest
The default
HttpRequest implementation.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri) Creates a new instance.DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, boolean validateHeaders) Deprecated.DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, HttpHeaders headers) Creates a new instance.DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, HttpHeadersFactory headersFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.getUri()Deprecated.inthashCode()method()Returns theHttpMethodof thisHttpRequest.setMethod(HttpMethod method) Set theHttpMethodof thisHttpRequest.setProtocolVersion(HttpVersion version) Set the protocol version of thisHttpMessageSet the requested URI (or alternatively, path)toString()uri()Returns the requested URI (or alternatively, path)Methods inherited from class io.netty.handler.codec.http.DefaultHttpMessage
getProtocolVersion, headers, protocolVersionMethods inherited from class io.netty.handler.codec.http.DefaultHttpObject
decoderResult, getDecoderResult, setDecoderResultMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResultMethods inherited from interface io.netty.handler.codec.http.HttpMessage
getProtocolVersion, headers, protocolVersionMethods inherited from interface io.netty.handler.codec.http.HttpObject
getDecoderResult
-
Constructor Details
-
DefaultHttpRequest
Creates a new instance.- Parameters:
httpVersion- the HTTP version of the requestmethod- the HTTP method of the requesturi- the URI or path of the request
-
DefaultHttpRequest
@Deprecated public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, boolean validateHeaders) Deprecated.Prefer theDefaultHttpRequest(HttpVersion, HttpMethod, String)constructor instead, to always have header validation enabled.Creates a new instance.- Parameters:
httpVersion- the HTTP version of the requestmethod- the HTTP method of the requesturi- the URI or path of the requestvalidateHeaders- validate the header names and values when adding them to theHttpHeaders
-
DefaultHttpRequest
public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, HttpHeadersFactory headersFactory) Creates a new instance.- Parameters:
httpVersion- the HTTP version of the requestmethod- the HTTP method of the requesturi- the URI or path of the requestheadersFactory- theHttpHeadersFactoryused to create the headers for this Request. The recommended default isDefaultHttpHeadersFactory.headersFactory().
-
DefaultHttpRequest
public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, HttpHeaders headers) Creates a new instance.- Parameters:
httpVersion- the HTTP version of the requestmethod- the HTTP method of the requesturi- the URI or path of the requestheaders- the Headers for this Request
-
-
Method Details
-
getMethod
Deprecated.- Specified by:
getMethodin interfaceHttpRequest
-
method
Description copied from interface:HttpRequestReturns theHttpMethodof thisHttpRequest.- Specified by:
methodin interfaceHttpRequest- Returns:
- The
HttpMethodof thisHttpRequest
-
getUri
Deprecated.- Specified by:
getUriin interfaceHttpRequest
-
uri
Description copied from interface:HttpRequestReturns the requested URI (or alternatively, path)- Specified by:
uriin interfaceHttpRequest- Returns:
- The URI being requested
-
setMethod
Description copied from interface:HttpRequestSet theHttpMethodof thisHttpRequest.- Specified by:
setMethodin interfaceHttpRequest
-
setUri
Description copied from interface:HttpRequestSet the requested URI (or alternatively, path)- Specified by:
setUriin interfaceHttpRequest
-
setProtocolVersion
Description copied from interface:HttpMessageSet the protocol version of thisHttpMessage- Specified by:
setProtocolVersionin interfaceHttpMessage- Specified by:
setProtocolVersionin interfaceHttpRequest- Overrides:
setProtocolVersionin classDefaultHttpMessage
-
hashCode
public int hashCode()- Overrides:
hashCodein classDefaultHttpMessage
-
equals
- Overrides:
equalsin classDefaultHttpMessage
-
toString
-
DefaultHttpRequest(HttpVersion, HttpMethod, String)constructor instead, to always have header validation enabled.