Child pages
  • WsRequest

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryReturns the name of the character encoding used in the body of this request.

servoy sSummary12%30%58%height: 30px;3Methods SummaryReturns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.Returns the MIME type of the body of the request, or <code>null</code> if the type is not known.Returns the portion of the request URI that indicates the context of the request.Returns an array containing all of the <code>Cookie</code> objects the client sent with this request.Returns the value of the specified request header as a <code>long</code> value that represents a <code>Date</code> object.Returns the value of the specified request header as a String.Returns an enumeration of all the header names this request contains.Returns all the values of the specified request header as an array of <code>String</code> objects.Returns the value of the specified request header as an <code>int</code>.Returns the Internet Protocol (IP) address of the interface on which the request was received.Returns the host name of the Internet Protocol (IP) interface on which the request was received.Returns the Internet Protocol (IP) port number of the interface on which the request was received.Returns the preferred <code>Locale</code> that the client will accept content in, based on the Accept-Language header.Returns an array of <code>Locale</code> objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.Returns the value of a request parameter as a <code>String</code>, or <code>null</code> if the parameter does not exist.Returns an object of the parameters of this request.Returns an array of <code>String</code> objects containing the names of the parameters contained in this request.Returns an array of <code>String</code> objects containing all of the values the given request parameter has, or <code>null</code> if the parameter does not exist.Returns any extra path information associated with the URL the client sent when it made this request.Returns any extra path information after the servlet name but before the query string, and translates it to a real path.Returns the name and version of the protocol the request uses in the form <i>protocol/majorVersion.Returns the query string that is contained in the request URL after the path.Gets the <i>real</i> path corresponding to the given <i>virtual</i> path.Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.Returns the fully qualified name of the client or the last proxy that sent the request.Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.Reconstructs the URL the client used to make the request.Returns the name of the scheme used to make this request, for example, <code>http</code>, <code>https</code>, or <code>ftp</code>.Returns the host name of the server to which the request was sent.Returns the port number to which the request was sent.Returns the part of this request's URL that calls the servlet.Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

propertyservoy sDetail2100%height:30px2Property DetailscharacterEncodingname

characterEncoding

dessIndent
Returns the name of the character encoding used in the body of this
request. This method returns <code>null</code> if the request
does not specify a character encoding
ret

Returns

sIndent a <code>String</code> containing the name of the character encoding, or <code>null</code> if the request does not specify a character encoding
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods DetailsgetContentLengthname

getContentLength()

dessIndent
Returns the length, in bytes, of the request body and made available by
the input stream, or -1 if the length is not known. For HTTP servlets,
same as the value of the CGI variable CONTENT_LENGTH.
ret

Returns

sIndent a long containing the length of the request body or -1L if the length is not known
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetContentTypename

getContentType()

dessIndent
Returns the MIME type of the body of the request, or
<code>null</code> if the type is not known. For HTTP servlets,
same as the value of the CGI variable CONTENT_TYPE.
ret

Returns

sIndent a <code>String</code> containing the name of the MIME type of the request, or null if the type is not known
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getContextPathname

getContextPath()

dessIndent
Returns the portion of the request URI that indicates the context
of the request. The context path always comes first in a request
URI. The path starts with a "/" character but does not end with a "/"
character. For servlets in the default (root) context, this method
returns "". The container does not decode this string.

<p>It is possible that a servlet container may match a context by
more than one context path. In such cases this method will return the
actual context path used by the request and it may differ from the
path returned by the
javax.servlet.ServletContext#getContextPath() method.
The context path returned by
javax.servlet.ServletContext#getContextPath()
should be considered as the prime or preferred context path of the
application.
ret

Returns

sIndent
clients

Supported Clients

sam a <code>String</code> specifying the portion of the request URI that indicates the context of the requestclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getCookiesname

getCookies()

dessIndent
Returns an array containing all of the <code>Cookie</code>
objects the client sent with this request.
This method returns an empty array if no cookies were sent.
ret

Returns

sIndent an array of all the <code>Cookies</code> included with this request, or <code>null</code> if the request has no cookies
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getDateHeadername

getDateHeader(name)

dessIndent
Returns the value of the specified request header
as a <code>long</code> value that represents a
<code>Date</code> object. Use this method with
headers that contain dates, such as
<code>If-Modified-Since</code>.

<p>The date is returned as
the number of milliseconds since January 1, 1970 GMT.
The header name is case insensitive.

<p>If the request did not have a header of the
specified name, this method returns -1. If the header
can't be converted to a date, the method throws
an <code>IllegalArgumentException</code>.
prs

Parameters

sIndentnamea <code>String</code> specifying the name of the header
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
a <code>long</code> value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the requestclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getHeadername

getHeader(String)

dessIndent
Returns the value of the specified request header as a String.
If the request did not include a header of the specified name, this method returns null.
If there are multiple headers with the same name, this method returns the first head in the request.
The header name is case insensitive. You can use this method with any request header.
prs

Parameters

sIndent
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getHeaderNamesname

getHeaderNames()

dessIndent
Returns an enumeration of all the header names
this request contains. If the request has no
headers, this method returns an empty enumeration.

<p>Some servlet containers do not allow
servlets to access headers using this method, in
which case this method returns <code>null</code>
ret

Returns

sIndent an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet container does not allow servlets to use this method, <code>null</code>
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getHeadersname

getHeaders(name)

dessIndent
Returns all the values of the specified request header
as an array of <code>String</code> objects.

<p>Some headers, such as <code>Accept-Language</code> can be sent
by clients as several headers each with a different value rather than
sending the header as a comma separated list.

<p>If the request did not include any headers
of the specified name, this method returns an empty
array.
The header name is case insensitive. You can use
this method with any request header.
prs

Parameters

sIndentnamea <code>String</code> specifying the header name
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient, an array containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return nullclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getIntHeadername

getIntHeader(name)

dessIndent
Returns the value of the specified request header
as an <code>int</code>. If the request does not have a header
of the specified name, this method returns -1. If the
header cannot be converted to an integer, this method
throws a <code>NumberFormatException</code>.

<p>The header name is case insensitive.
prs

Parameters

sIndentnamea <code>String</code> specifying the name of a request header
ret

Returns

sIndent an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getLocalAddrname

getLocalAddr()

dessIndent
Returns the Internet Protocol (IP) address of the interface on
which the request  was received.
ret

Returns

sIndent a <code>String</code> containing the IP address on which the request was received.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getLocalNamename

getLocalName()

dessIndent
Returns the host name of the Internet Protocol (IP) interface on
which the request was received.
ret

Returns

sIndent a <code>String</code> containing the host name of the IP on which the request was received.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getLocalPortname

getLocalPort()

dessIndent
Returns the Internet Protocol (IP) port number of the interface
on which the request was received.
ret

Returns

sIndent an integer specifying the port number
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getLocaleLanguageTagname

getLocaleLanguageTag()

dessIndent
Returns the preferred <code>Locale</code> that the client will
accept content in, based on the Accept-Language header.
If the client request doesn't provide an Accept-Language header,
this method returns the default locale for the server.

Returns a well-formed IETF BCP 47 language tag representing
this locale.
ret

Returns

sIndent the preferred <code>Locale</code> for the client
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getLocalesLanguageTagsname

getLocalesLanguageTags()

dessIndent
Returns an array of <code>Locale</code> objects
indicating, in decreasing order starting with the preferred locale, the
locales that are acceptable to the client based on the Accept-Language
header.
If the client request doesn't provide an Accept-Language header,
this method returns an array containing one
<code>Locale</code>, the default locale for the server.

Returns well-formed IETF BCP 47 language tags representing
the locales.
ret

Returns

sIndent an array of preferred <code>Locale</code> objects for the client
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getMethodname

getMethod()

dessIndent
Returns the name of the HTTP method with which this
request was made, for example, GET, POST, or PUT.
Same as the value of the CGI variable REQUEST_METHOD.
ret

Returns

sIndent a <code>String</code> specifying the name of the method with which this request was made
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getParametername

getParameter(name)

dessIndent
Returns the value of a request parameter as a <code>String</code>,
or <code>null</code> if the parameter does not exist. Request parameters
are extra information sent with the request.  For HTTP servlets,
parameters are contained in the query string or posted form data.

<p>You should only use this method when you are sure the
parameter has only one value. If the parameter might have
more than one value, use #getParameterValues(String).

<p>If you use this method with a multivalued
parameter, the value returned is equal to the first value
in the array returned by <code>getParameterValues</code>.

<p>If the parameter data was sent in the request body, such as occurs
with an HTTP POST request, then reading the body directly via 
#getInputStream or #getReader can interfere
with the execution of this method.
prs

Parameters

sIndentnamea <code>String</code> specifying the name of the parameter
ret

Returns

sIndent a <code>String</code> representing the single value of the parameter
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getParameterMapname

getParameterMap()

dessIndent
Returns an object of the parameters of this request.

<p>Request parameters are extra information sent with the request.
For HTTP servlets, parameters are contained in the query string or
posted form data.
ret

Returns

sIndent an object containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getParameterNamesname

getParameterNames()

dessIndent
Returns an array of <code>String</code>
objects containing the names of the parameters contained
in this request. If the request has
no parameters, the method returns an empty array.
ret

Returns

sIndent an array of <code>String</code> objects, each <code>String</code> containing the name of a request parameter; or an empty array if the request has no parameters
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getParameterValuesname

getParameterValues(name)

dessIndent
Returns an array of <code>String</code> objects containing
all of the values the given request parameter has, or
<code>null</code> if the parameter does not exist.

<p>If the parameter has a single value, the array has a length
of 1.
prs

Parameters

sIndentnamea <code>String</code> containing the name of the parameter whose value is requested
ret

Returns

sIndentret

Returns

sIndent an array of <code>String</code> objects containing the parameter's values
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getPathInfoname

getPathInfo()

dessIndent
Returns any extra path information associated with
the URL the client sent when it made this request.
The extra path information follows the servlet path
but precedes the query string and will start with
a "/" character.

<p>This method returns <code>null</code> if there
was no extra path information.

<p>Same as the value of the CGI variable PATH_INFO.
ret

Returns

sIndent a <code>String</code>, decoded by the web container, specifying extra path information that comes after the servlet path but before the query string in the request URL; or <code>null</code> if the URL does not have any extra path information
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getPathTranslatedname

getPathTranslated()

dessIndent
Returns any extra path information after the servlet name
but before the query string, and translates it to a real
path. Same as the value of the CGI variable PATH_TRANSLATED.

<p>If the URL does not have any extra path information,
this method returns <code>null</code> or the servlet container
cannot translate the virtual path to a real path for any reason
(such as when the web application is executed from an archive).

The web container does not decode this string.
ret

ReturnssIndent

Returns

sIndent a <code>String</code> specifying the real path, or <code>null</code> if the URL does not have any extra path information
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getProtocolname

getProtocol()

dessIndent
Returns the name and version of the protocol the request uses
in the form <i>protocol/majorVersion.minorVersion</i>, for
example, HTTP/1.1. For HTTP servlets, the value
returned is the same as the value of the CGI variable
<code>SERVER_PROTOCOL</code>.
ret

Returns

sIndent a <code>String</code> containing the protocol name and version number
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getQueryStringname

getQueryString()

dessIndent
Returns the query string that is contained in the request
URL after the path. This method returns <code>null</code>
if the URL does not have a query string. Same as the value
of the CGI variable QUERY_STRING.
ret

Returns

sIndent a <code>String</code> containing the query string or <code>null</code> if the URL contains no query string. The value is not decoded by the container.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRealPathname

getRealPath(path)

dessIndent
Gets the <i>real</i> path corresponding to the given
<i>virtual</i> path.
prs

Parameters

sIndentpaththe <i>virtual</i> path to be translated to a <i>real</i> path
ret

Returns

sIndent the <i>real</i> path, or <tt>null</tt> if the translation cannot be performed
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRemoteAddrname

getRemoteAddr()

dessIndent
Returns the Internet Protocol (IP) address of the client
or last proxy that sent the request.
For HTTP servlets, same as the value of the
CGI variable <code>REMOTE_ADDR</code>.
ret

Returns

sIndent
ret

Returns

sIndent a <code>String</code> containing the IP address of the client that sent the request
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetRemoteHostname

getRemoteHost()

dessIndent
Returns the fully qualified name of the client
or the last proxy that sent the request.
If the engine cannot or chooses not to resolve the hostname
(to improve performance), this method returns the dotted-string form of
the IP address. For HTTP servlets, same as the value of the CGI variable
<code>REMOTE_HOST</code>.
ret

Returns

sIndent a <code>String</code> containing the fully qualified name of the client
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRemotePortname

getRemotePort()

dessIndent
Returns the Internet Protocol (IP) source port of the client
or last proxy that sent the request.
ret

Returns

sIndent an integer specifying the port number
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRequestURIname

getRequestURI()

dessIndent
Returns the part of this request's URL from the protocol
name up to the query string in the first line of the HTTP request.
The web container does not decode this String.
For example:

<table summary="Examples of Returned Values">
<tr align=left><th>First line of HTTP request      </th>
<th>     Returned Value</th>
<tr><td>POST /some/path.html HTTP/1.1<td><td>/some/path.html
<tr><td>GET http://foo.bar/a.html HTTP/1.0
<td><td>/a.html
<tr><td>HEAD /xyz?a=b HTTP/1.1<td><td>/xyz
</table>
ret

Returns

sIndent a <code>String</code> containing the part of the URL from the protocol name up to the query string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRequestURLname

getRequestURL()

dessIndent
Reconstructs the URL the client used to make the request.
The returned URL contains a protocol, server name, port
number, and server path, but it does not include query
string parameters.

<p>If this request has been forwarded using
javax.servlet.RequestDispatcher#forward(ServletRequest,ServletResponse), the server path in the
reconstructed URL must reflect the path used to obtain the
RequestDispatcher, and not the server path specified by the client.

<p>This method is useful for creating redirect messages
and for reporting errors.
ret

Returns

sIndent a <code>StringBuffer</code> object containing the reconstructed URL
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getSchemename

getScheme()

dessIndent
Returns the name of the scheme used to make this request,
for example,
<code>http</code>, <code>https</code>, or <code>ftp</code>.
Different schemes have different rules for constructing URLs,
as noted in RFC 1738.
ret

Returns

sIndent

sIndent a <code>String</code> containing the name of the scheme used to make this requestclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getServerNamename

getServerName()

dessIndent
Returns the host name of the server to which the request was sent.
It is the value of the part before ":" in the <code>Host</code>
header value, if any, or the resolved server name, or the server IP
address.
ret

Returns

sIndent a <code>String</code> containing the name of the server
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getServerPortname

getServerPort()

dessIndent
Returns the port number to which the request was sent.
It is the value of the part after ":" in the <code>Host</code>
header value, if any, or the server port where the client connection
was accepted on.
ret

Returns

sIndent an integer specifying the port number
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getServletPathname

getServletPath()

dessIndent
Returns the part of this request's URL that calls
the servlet. This path starts with a "/" character
and includes either the servlet name or a path to
the servlet, but does not include any extra path
information or a query string. Same as the value of
the CGI variable SCRIPT_NAME.

<p>This method will return an empty string ("") if the
servlet used to process this request was matched using
the "/*" pattern.
ret

Returns

sIndent a <code>String</code> containing the name or path of the servlet being called, as specified in the request URL, decoded, or an empty string if the servlet used to process the request is matched using the "/*" pattern.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isSecurename

isSecure()

dessIndent
Returns a boolean indicating whether this request was made using a
secure channel, such as HTTPS.
ret

Returns

sIndent a boolean indicating if the request was made using a secure channel
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow