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:
DecoderResultProvider
,HttpMessage
,HttpObject
,HttpRequest
- Direct Known Subclasses:
DefaultFullHttpRequest
public class DefaultHttpRequest extends DefaultHttpMessage implements HttpRequest
The defaultHttpRequest
implementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri)
Creates a new instance.DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, boolean validateHeaders)
Deprecated.Prefer theDefaultHttpRequest(HttpVersion, HttpMethod, String)
constructor instead, to always have header validation enabled.DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, HttpHeaders headers)
Creates a new instance.DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, HttpHeadersFactory headersFactory)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
HttpMethod
getMethod()
Deprecated.java.lang.String
getUri()
Deprecated.int
hashCode()
HttpMethod
method()
Returns theHttpMethod
of thisHttpRequest
.HttpRequest
setMethod(HttpMethod method)
Set theHttpMethod
of thisHttpRequest
.HttpRequest
setProtocolVersion(HttpVersion version)
Set the protocol version of thisHttpMessage
HttpRequest
setUri(java.lang.String uri)
Set the requested URI (or alternatively, path)java.lang.String
toString()
java.lang.String
uri()
Returns the requested URI (or alternatively, path)-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from class io.netty.handler.codec.http.DefaultHttpObject
decoderResult, getDecoderResult, setDecoderResult
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.handler.codec.DecoderResultProvider
decoderResult, setDecoderResult
-
Methods inherited from interface io.netty.handler.codec.http.HttpMessage
getProtocolVersion, headers, protocolVersion
-
Methods inherited from interface io.netty.handler.codec.http.HttpObject
getDecoderResult
-
-
-
-
Constructor Detail
-
DefaultHttpRequest
public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri)
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, java.lang.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, java.lang.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
- theHttpHeadersFactory
used to create the headers for this Request. The recommended default isDefaultHttpHeadersFactory.headersFactory()
.
-
DefaultHttpRequest
public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.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 Detail
-
getMethod
@Deprecated public HttpMethod getMethod()
Deprecated.- Specified by:
getMethod
in interfaceHttpRequest
-
method
public HttpMethod method()
Description copied from interface:HttpRequest
Returns theHttpMethod
of thisHttpRequest
.- Specified by:
method
in interfaceHttpRequest
- Returns:
- The
HttpMethod
of thisHttpRequest
-
getUri
@Deprecated public java.lang.String getUri()
Deprecated.- Specified by:
getUri
in interfaceHttpRequest
-
uri
public java.lang.String uri()
Description copied from interface:HttpRequest
Returns the requested URI (or alternatively, path)- Specified by:
uri
in interfaceHttpRequest
- Returns:
- The URI being requested
-
setMethod
public HttpRequest setMethod(HttpMethod method)
Description copied from interface:HttpRequest
Set theHttpMethod
of thisHttpRequest
.- Specified by:
setMethod
in interfaceHttpRequest
-
setUri
public HttpRequest setUri(java.lang.String uri)
Description copied from interface:HttpRequest
Set the requested URI (or alternatively, path)- Specified by:
setUri
in interfaceHttpRequest
-
setProtocolVersion
public HttpRequest setProtocolVersion(HttpVersion version)
Description copied from interface:HttpMessage
Set the protocol version of thisHttpMessage
- Specified by:
setProtocolVersion
in interfaceHttpMessage
- Specified by:
setProtocolVersion
in interfaceHttpRequest
- Overrides:
setProtocolVersion
in classDefaultHttpMessage
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDefaultHttpMessage
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classDefaultHttpMessage
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-