Package io.netty.handler.codec.http
Class DefaultHttpResponse
java.lang.Object
io.netty.handler.codec.http.DefaultHttpObject
io.netty.handler.codec.http.DefaultHttpMessage
io.netty.handler.codec.http.DefaultHttpResponse
- All Implemented Interfaces:
io.netty.handler.codec.DecoderResultProvider,HttpMessage,HttpObject,HttpResponse
- Direct Known Subclasses:
DefaultFullHttpResponse
The default
HttpResponse implementation.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpResponse(HttpVersion version, HttpResponseStatus status) Creates a new instance.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders) Deprecated.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders) Deprecated.Use theDefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, HttpHeaders headers) Creates a new instance.DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, HttpHeadersFactory headersFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.inthashCode()setProtocolVersion(HttpVersion version) Set the protocol version of thisHttpMessagesetStatus(HttpResponseStatus status) Set the status of thisHttpResponse.status()Returns the status of thisHttpResponse.toString()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
-
DefaultHttpResponse
Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this response
-
DefaultHttpResponse
@Deprecated public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders) Deprecated.Use theDefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responsevalidateHeaders- validate the header names and values when adding them to theHttpHeaders
-
DefaultHttpResponse
@Deprecated public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders) Deprecated.Use theDefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responsevalidateHeaders- validate the header names and values when adding them to theHttpHeaderssingleFieldHeaders-trueto check and enforce that headers with the same name are appended to the same entry and comma separated. See RFC 7230, 3.2.2.falseto allow multiple header entries with the same name to coexist.
-
DefaultHttpResponse
public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, HttpHeadersFactory headersFactory) Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responseheadersFactory- theHttpHeadersFactoryused to create the headers for this HTTP Response. The recommended default isDefaultHttpHeadersFactory.headersFactory().
-
DefaultHttpResponse
Creates a new instance.- Parameters:
version- the HTTP version of this responsestatus- the status of this responseheaders- the headers for this HTTP Response
-
-
Method Details
-
getStatus
Deprecated.- Specified by:
getStatusin interfaceHttpResponse
-
status
Description copied from interface:HttpResponseReturns the status of thisHttpResponse.- Specified by:
statusin interfaceHttpResponse- Returns:
- The
HttpResponseStatusof thisHttpResponse
-
setStatus
Description copied from interface:HttpResponseSet the status of thisHttpResponse.- Specified by:
setStatusin interfaceHttpResponse
-
setProtocolVersion
Description copied from interface:HttpMessageSet the protocol version of thisHttpMessage- Specified by:
setProtocolVersionin interfaceHttpMessage- Specified by:
setProtocolVersionin interfaceHttpResponse- Overrides:
setProtocolVersionin classDefaultHttpMessage
-
toString
-
hashCode
public int hashCode()- Overrides:
hashCodein classDefaultHttpMessage
-
equals
- Overrides:
equalsin classDefaultHttpMessage
-
DefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)constructor instead.