B
- The body@Internal public abstract class AbstractNettyHttpRequest<B> extends io.netty.util.DefaultAttributeMap implements HttpRequest<B>, NettyHttpRequestBuilder
HttpRequest
for Netty.Modifier and Type | Field and Description |
---|---|
protected ConversionService<?> |
conversionService |
static io.netty.util.AsciiString |
HTTP2_SCHEME |
protected HttpMethod |
httpMethod |
protected java.lang.String |
httpMethodName |
protected io.netty.handler.codec.http.HttpRequest |
nettyRequest |
static io.netty.util.AsciiString |
STREAM_ID |
protected java.net.URI |
uri |
SCHEME_HTTP, SCHEME_HTTPS
Constructor and Description |
---|
AbstractNettyHttpRequest(io.netty.handler.codec.http.HttpRequest nettyRequest,
ConversionService conversionService) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<MediaType> |
accept()
A list of accepted
MediaType instances sorted by their quality rating. |
protected io.netty.handler.codec.http.QueryStringDecoder |
createDecoder(java.lang.String uri) |
java.nio.charset.Charset |
getCharacterEncoding() |
java.util.Optional<MediaType> |
getContentType()
The request or response content type.
|
HttpVersion |
getHttpVersion() |
java.util.Optional<java.util.Locale> |
getLocale() |
HttpMethod |
getMethod() |
java.lang.String |
getMethodName() |
io.netty.handler.codec.http.HttpRequest |
getNettyRequest() |
HttpParameters |
getParameters() |
java.lang.String |
getPath() |
java.net.URI |
getUri() |
protected abstract java.nio.charset.Charset |
initCharset(java.nio.charset.Charset characterEncoding) |
boolean |
isStream() |
io.netty.handler.codec.http.FullHttpRequest |
toFullHttpRequest()
Converts this object to a full http request.
|
io.netty.handler.codec.http.HttpRequest |
toHttpRequest()
Converts this object to the most appropriate http request type.
|
StreamedHttpRequest |
toStreamHttpRequest()
Converts this object to a streamed http request.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, create, DELETE, DELETE, DELETE, GET, GET, getCertificate, getCookies, getRemoteAddress, getServerAddress, getServerName, getUserPrincipal, getUserPrincipal, HEAD, HEAD, isSecure, mutate, OPTIONS, OPTIONS, PATCH, PATCH, POST, POST, PUT, PUT, setAttribute
getAttributes, getBody, getBody, getBody, getContentLength, getHeaders
removeAttribute
getAttribute, getAttribute
toHttpRequest
public static final io.netty.util.AsciiString STREAM_ID
public static final io.netty.util.AsciiString HTTP2_SCHEME
protected final io.netty.handler.codec.http.HttpRequest nettyRequest
protected final ConversionService<?> conversionService
protected final HttpMethod httpMethod
protected final java.net.URI uri
protected final java.lang.String httpMethodName
public AbstractNettyHttpRequest(io.netty.handler.codec.http.HttpRequest nettyRequest, ConversionService conversionService)
nettyRequest
- The Http netty requestconversionService
- The conversion service@NonNull public io.netty.handler.codec.http.HttpRequest toHttpRequest()
NettyHttpRequestBuilder
toHttpRequest
in interface NettyHttpRequestBuilder
@NonNull public io.netty.handler.codec.http.FullHttpRequest toFullHttpRequest()
NettyHttpRequestBuilder
toFullHttpRequest
in interface NettyHttpRequestBuilder
@NonNull public StreamedHttpRequest toStreamHttpRequest()
NettyHttpRequestBuilder
toStreamHttpRequest
in interface NettyHttpRequestBuilder
public boolean isStream()
isStream
in interface NettyHttpRequestBuilder
public HttpVersion getHttpVersion()
getHttpVersion
in interface HttpRequest<B>
public io.netty.handler.codec.http.HttpRequest getNettyRequest()
public HttpParameters getParameters()
getParameters
in interface HttpRequest<B>
public java.util.Collection<MediaType> accept()
HttpRequest
MediaType
instances sorted by their quality rating.accept
in interface HttpRequest<B>
MediaType
instancespublic java.util.Optional<MediaType> getContentType()
HttpMessage
getContentType
in interface HttpMessage<B>
public java.nio.charset.Charset getCharacterEncoding()
getCharacterEncoding
in interface HttpMessage<B>
StandardCharsets.UTF_8
public java.util.Optional<java.util.Locale> getLocale()
getLocale
in interface HttpMessage<B>
getLocale
in interface HttpRequest<B>
public HttpMethod getMethod()
getMethod
in interface HttpRequest<B>
public java.net.URI getUri()
getUri
in interface HttpRequest<B>
public java.lang.String getPath()
getPath
in interface HttpRequest<B>
protected abstract java.nio.charset.Charset initCharset(java.nio.charset.Charset characterEncoding)
characterEncoding
- The charactger encodingprotected io.netty.handler.codec.http.QueryStringDecoder createDecoder(java.lang.String uri)
uri
- The URIpublic java.lang.String getMethodName()
getMethodName
in interface HttpRequest<B>
HttpMethod
value for standard http methods).