UpgradeRequest

The HTTP Upgrade to WebSocket Request

Members

Functions

addExtensions
void addExtensions(ExtensionConfig[] configs)

Add WebSocket Extension Configuration(s) to Upgrade Request. <p> This is merely the list of requested Extensions to use, see {@link UpgradeResponse#getExtensions()} for what was negotiated

addExtensions
void addExtensions(string[] configs)

Add WebSocket Extension Configuration(s) to request <p> This is merely the list of requested Extensions to use, see {@link UpgradeResponse#getExtensions()} for what was negotiated

getCookies
List!(Cookie) getCookies()

Get the list of Cookies on the Upgrade request

getExtensions
List!(ExtensionConfig) getExtensions()

Get the list of WebSocket Extension Configurations for this Upgrade Request. <p> This is merely the list of requested Extensions to use, see {@link UpgradeResponse#getExtensions()} for what was negotiated

getHeader
string getHeader(string name)

Get a specific Header value from Upgrade Request

getHeaderInt
int getHeaderInt(string name)

Get the specific Header value, as an <code>int</code>, from the Upgrade Request.

getHeaders
Map!(string, List!(string)) getHeaders()

Get the headers as a Map of keys to value lists.

getHeaders
List!(string) getHeaders(string name)

Get the specific header values (for multi-value headers)

getHost
string getHost()

The host of the Upgrade Request URI

getHttpVersion
string getHttpVersion()

The HTTP version used for this Upgrade Request <p> As of <a href="http://tools.ietf.org/html/rfc6455">RFC6455 (December 2011)</a> this is always <code>HTTP/1.1</code>

getMethod
string getMethod()

The HTTP method for this Upgrade Request. <p> As of <a href="http://tools.ietf.org/html/rfc6455">RFC6455 (December 2011)</a> this is always <code>GET</code>

getOrigin
string getOrigin()

The WebSocket Origin of this Upgrade Request <p> See <a href="http://tools.ietf.org/html/rfc6455#section-10.2">RFC6455: Section 10.2</a> for details. <p> Equivalent to {@link #getHeader(string)} passed the "Origin" header.

getParameterMap
Map!(string, List!(string)) getParameterMap()

Returns a map of the query parameters of the request.

getProtocolVersion
string getProtocolVersion()

Get the WebSocket Protocol Version <p> As of <a href="http://tools.ietf.org/html/rfc6455#section-11.6">RFC6455</a>, Hunt only supports version <code>13</code>

getQueryString
string getQueryString()

Get the Query string of the request URI.

getRequestURI
HttpURI getRequestURI()

Get the Request URI

getSession
Object getSession()

Access the Servlet HTTP Session (if present) <p> Note: Never present on a Client UpgradeRequest.

getSubProtocols
List!(string) getSubProtocols()

Get the list of offered WebSocket sub-protocols.

hasSubProtocol
bool hasSubProtocol(string test)

Test if a specific sub-protocol is offered

isOrigin
bool isOrigin(string test)

Test if supplied Origin is the same as the Request

isSecure
bool isSecure()

Test if connection is secure.

setCookies
void setCookies(List!(Cookie) cookies)

Set the list of Cookies on the request

setExtensions
void setExtensions(List!(ExtensionConfig) configs)

Set the list of WebSocket Extension configurations on the request.

setHeader
void setHeader(string name, List!(string) values)

Set a specific header with multi-value field <p> Overrides any previous value for this named header

setHeader
void setHeader(string name, string value)

Set a specific header value <p> Overrides any previous value for this named header

setHeaders
void setHeaders(Map!(string, List!(string)) headers)

Sets multiple headers on the request. <p> Only sets those headers provided, does not remove headers that exist on request and are not provided in the parameter for this method. <p> Convenience method vs calling {@link #setHeader(string, List)} multiple times.

setHttpVersion
void setHttpVersion(string httpVersion)

Set the HTTP Version to use. <p> As of <a href="http://tools.ietf.org/html/rfc6455">RFC6455 (December 2011)</a> this should always be <code>HTTP/1.1</code>

setMethod
void setMethod(string method)

Set the HTTP method to use. <p> As of <a href="http://tools.ietf.org/html/rfc6455">RFC6455 (December 2011)</a> this is always <code>GET</code>

setRequestURI
void setRequestURI(HttpURI uri)

Set the Request URI to use for this request. <p> Must be an absolute URI with scheme <code>'ws'</code> or <code>'wss'</code>

setSession
void setSession(Object session)

Set the Session associated with this request. <p> Typically used to associate the Servlet HttpSession object.

setSubProtocols
void setSubProtocols(List!(string) protocols)

Set the offered WebSocket Sub-Protocol list.

setSubProtocols
void setSubProtocols(string[] protocols)

Set the offered WebSocket Sub-Protocol list.

Meta