public abstract class HttpServerRequest<T>
extends java.lang.Object
| Constructor and Description |
|---|
HttpServerRequest() |
| Modifier and Type | Method and Description |
|---|---|
abstract HttpServerRequest<T> |
addCookie(io.netty.handler.codec.http.cookie.Cookie cookie)
Adds the passed
cookie to this request. |
abstract HttpServerRequest<T> |
addDateHeader(java.lang.CharSequence name,
java.util.Date value)
Adds the passed header as a date value to this request.
|
abstract HttpServerRequest<T> |
addDateHeader(java.lang.CharSequence name,
java.lang.Iterable<java.util.Date> values)
Adds multiple date values for the passed header name to this request.
|
abstract HttpServerRequest<T> |
addHeader(java.lang.CharSequence name,
java.lang.Iterable<java.lang.Object> values)
Adds an HTTP header with the passed
name and values to this request. |
abstract HttpServerRequest<T> |
addHeader(java.lang.CharSequence name,
java.lang.Object value)
Adds an HTTP header with the passed
name and value to this request. |
abstract boolean |
containsHeader(java.lang.CharSequence name)
Checks if there is a header with the passed name in this request.
|
abstract boolean |
containsHeader(java.lang.CharSequence name,
java.lang.CharSequence value,
boolean ignoreCaseValue)
Checks if there is a header with the passed name and value in this request.
|
abstract rx.Observable<java.lang.Void> |
discardContent()
Subscribes to the content and discards.
|
abstract rx.Observable<java.lang.Void> |
dispose()
Disposes this request.
|
abstract java.util.List<java.lang.String> |
getAllHeaderValues(java.lang.CharSequence name)
Returns the values of headers with the specified name
|
abstract io.reactivex.netty.channel.ContentSource<T> |
getContent()
Returns the content as a stream.
|
abstract long |
getContentLength()
Returns the length of the content.
|
abstract long |
getContentLength(long defaultValue)
Returns the length of the content.
|
abstract java.util.Map<java.lang.String,java.util.Set<io.netty.handler.codec.http.cookie.Cookie>> |
getCookies()
Returns an immutable map of cookie names and cookies contained in this request.
|
abstract long |
getDateHeader(java.lang.CharSequence name)
Returns the date header value with the specified header name.
|
abstract long |
getDateHeader(java.lang.CharSequence name,
long defaultValue)
Returns the date header value with the specified header name.
|
abstract java.lang.String |
getDecodedPath()
Returns the decoded URI path for this request.
|
abstract java.lang.String |
getHeader(java.lang.CharSequence name)
Returns the value of a header with the specified name.
|
abstract java.lang.String |
getHeader(java.lang.CharSequence name,
java.lang.String defaultValue)
Returns the value of a header with the specified name.
|
abstract java.util.Set<java.lang.String> |
getHeaderNames()
Returns a new
Set that contains the names of all headers in this request. |
abstract java.lang.String |
getHostHeader()
Returns the value of the
"Host" header. |
abstract java.lang.String |
getHostHeader(java.lang.String defaultValue)
Returns the value of the
"Host" header. |
abstract io.netty.handler.codec.http.HttpMethod |
getHttpMethod()
Returns the HTTP method for this request.
|
abstract io.netty.handler.codec.http.HttpVersion |
getHttpVersion()
Returns the HTTP version for this request.
|
abstract int |
getIntHeader(java.lang.CharSequence name)
Returns the integer header value with the specified header name.
|
abstract int |
getIntHeader(java.lang.CharSequence name,
int defaultValue)
Returns the integer header value with the specified header name.
|
abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getQueryParameters()
Returns an immutable map of query parameter names and values contained in this request.
|
abstract java.lang.String |
getRawQueryString()
Returns the query string for this request.
|
abstract java.lang.String |
getUri()
Returns the raw URI for the request, including path and query parameters.
|
abstract java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>> |
headerIterator()
Returns an iterator over the header entries.
|
abstract boolean |
is100ContinueExpected()
Returns
true if and only if this request contains the "Expect: 100-continue" header. |
abstract boolean |
isContentLengthSet()
Returns
true if and only if this request has the content-length header set. |
abstract boolean |
isKeepAlive()
Returns
true if and only if the connection can remain open and thus 'kept alive'. |
abstract boolean |
isTransferEncodingChunked()
Checks to see if the transfer encoding of this request is chunked
|
abstract boolean |
isWebSocketUpgradeRequested()
Checks to see if upgrade to websocket protocol is requested by this HTTP request.
|
abstract HttpServerRequest<T> |
removeHeader(java.lang.CharSequence name)
Removes the passed header from this request.
|
abstract HttpServerRequest<T> |
setDateHeader(java.lang.CharSequence name,
java.util.Date value)
Overwrites the current value, if any, of the passed header to the passed date value for this request.
|
abstract HttpServerRequest<T> |
setDateHeader(java.lang.CharSequence name,
java.lang.Iterable<java.util.Date> values)
Overwrites the current value, if any, of the passed header to the passed date values for this request.
|
abstract HttpServerRequest<T> |
setHeader(java.lang.CharSequence name,
java.lang.Iterable<java.lang.Object> values)
Overwrites the current value, if any, of the passed header to the passed values for this request.
|
abstract HttpServerRequest<T> |
setHeader(java.lang.CharSequence name,
java.lang.Object value)
Overwrites the current value, if any, of the passed header to the passed value for this request.
|
java.lang.String |
toString() |
abstract <X> HttpServerRequest<X> |
transformContent(rx.Observable.Transformer<T,X> transformer)
Creates a new
HttpServerRequest instance modifying the content type using the passed transformer. |
public abstract io.netty.handler.codec.http.HttpMethod getHttpMethod()
public abstract io.netty.handler.codec.http.HttpVersion getHttpVersion()
public abstract java.lang.String getUri()
public abstract java.lang.String getDecodedPath()
public abstract java.lang.String getRawQueryString()
public abstract java.util.Map<java.lang.String,java.util.Set<io.netty.handler.codec.http.cookie.Cookie>> getCookies()
public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getQueryParameters()
public abstract boolean containsHeader(java.lang.CharSequence name)
name - Name of the header.true if there is a header with the passed name in this request.public abstract boolean containsHeader(java.lang.CharSequence name,
java.lang.CharSequence value,
boolean ignoreCaseValue)
name - Name of the header.value - Value of the header.ignoreCaseValue - true then the value comparision is done ignoring case.true if there is a header with the passed name and value in this request.public abstract java.util.Iterator<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>> headerIterator()
public abstract java.lang.String getHeader(java.lang.CharSequence name)
name - The name of the header to searchnull if there is no such headerpublic abstract java.lang.String getHeader(java.lang.CharSequence name,
java.lang.String defaultValue)
name - The name of the header to searchdefaultValue - Default if the header does not exist.defaultValue if there is no such headerpublic abstract java.util.List<java.lang.String> getAllHeaderValues(java.lang.CharSequence name)
name - The name of the headers to searchList of header values which will be empty if no values are foundpublic abstract long getContentLength()
java.lang.NumberFormatException - if the message does not have the "Content-Length" header or its value is
not a number.public abstract long getContentLength(long defaultValue)
defaultValue - Default value if the message does not have a "Content-Length" header or its value is
not a numberdefaultValue if this message does not have the "Content-Length"
header or its value is not a numberpublic abstract long getDateHeader(java.lang.CharSequence name)
"E, dd MMM yyyy HH:mm:ss z"
name - The name of the header to searchpublic abstract long getDateHeader(java.lang.CharSequence name,
long defaultValue)
"E, dd MMM yyyy HH:mm:ss z"
name - The name of the header to searchdefaultValue - Default value if there is no header with this name.defaultValue if there is no header with this name.public abstract java.lang.String getHostHeader()
"Host" header.public abstract java.lang.String getHostHeader(java.lang.String defaultValue)
"Host" header.defaultValue - Default if the header does not exist."Host" header or defaultValue if there is no such header.public abstract int getIntHeader(java.lang.CharSequence name)
name - The name of the header to searchjava.lang.NumberFormatException - if there is no such header or the header value is not a numberpublic abstract int getIntHeader(java.lang.CharSequence name,
int defaultValue)
name - The name of the header to searchdefaultValue - Default if the header does not exist.defaultValue if there is no such header or the header value is not a
numberpublic abstract boolean is100ContinueExpected()
true if and only if this request contains the "Expect: 100-continue" header.public abstract boolean isContentLengthSet()
true if and only if this request has the content-length header set.public abstract boolean isKeepAlive()
true if and only if the connection can remain open and thus 'kept alive'. This methods respects
the value of the "Connection" header first and then the return value of
HttpVersion.isKeepAliveDefault().public abstract boolean isTransferEncodingChunked()
public abstract java.util.Set<java.lang.String> getHeaderNames()
Set that contains the names of all headers in this request. Note that modifying the
returned Set will not affect the state of this request.public abstract HttpServerRequest<T> addHeader(java.lang.CharSequence name, java.lang.Object value)
name and value to this request.name - Name of the header.value - Value for the header.thispublic abstract HttpServerRequest<T> addCookie(io.netty.handler.codec.http.cookie.Cookie cookie)
cookie to this request.cookie - Cookie to add.thispublic abstract HttpServerRequest<T> addDateHeader(java.lang.CharSequence name, java.util.Date value)
HttpHeaders.addDateHeader(HttpMessage, CharSequence, Date) which formats the date as per the
HTTP specifications into the format:
"E, dd MMM yyyy HH:mm:ss z"
name - Name of the header.value - Value of the header.thispublic abstract HttpServerRequest<T> addDateHeader(java.lang.CharSequence name, java.lang.Iterable<java.util.Date> values)
HttpHeaders.addDateHeader(HttpMessage, CharSequence, Date) which formats the date as per the
HTTP specifications into the format:
"E, dd MMM yyyy HH:mm:ss z"
name - Name of the header.values - Values for the header.thispublic abstract HttpServerRequest<T> addHeader(java.lang.CharSequence name, java.lang.Iterable<java.lang.Object> values)
name and values to this request.name - Name of the header.values - Values for the header.thispublic abstract HttpServerRequest<T> setDateHeader(java.lang.CharSequence name, java.util.Date value)
HttpHeaders.addDateHeader(HttpMessage, CharSequence, Date) which formats the date
as per the HTTP specifications into
the format:
"E, dd MMM yyyy HH:mm:ss z"
name - Name of the header.value - Value of the header.thispublic abstract HttpServerRequest<T> setHeader(java.lang.CharSequence name, java.lang.Object value)
name - Name of the header.value - Value of the header.thispublic abstract HttpServerRequest<T> setDateHeader(java.lang.CharSequence name, java.lang.Iterable<java.util.Date> values)
HttpHeaders.addDateHeader(HttpMessage, CharSequence, Date) which formats the
date as per the HTTP specifications
into the format:
"E, dd MMM yyyy HH:mm:ss z"
name - Name of the header.values - Values of the header.thispublic abstract HttpServerRequest<T> setHeader(java.lang.CharSequence name, java.lang.Iterable<java.lang.Object> values)
name - Name of the header.values - Values of the header.thispublic abstract HttpServerRequest<T> removeHeader(java.lang.CharSequence name)
name - Name of the header.thispublic abstract io.reactivex.netty.channel.ContentSource<T> getContent()
Subscriber to the returned Observable, any
subsequent subscriptions will get an error.public abstract rx.Observable<java.lang.Void> discardContent()
Observable, subscription to which will discard the content. This Observable will
error/complete when the content errors/completes and unsubscription from here will unsubscribe from the content.public abstract rx.Observable<java.lang.Void> dispose()
Observable, subscription to which will dispose this request. If the content is not yet
subscribed then this is the same as discardContent().public abstract boolean isWebSocketUpgradeRequested()
true if upgrade to websocket is requested.public abstract <X> HttpServerRequest<X> transformContent(rx.Observable.Transformer<T,X> transformer)
HttpServerRequest instance modifying the content type using the passed transformer.X - New type of the content.transformer - Transformer to transform the content stream.HttpServerRequest with the transformed content stream.public java.lang.String toString()
toString in class java.lang.Object