Request

The Request object retrieves the values that the client browser passed to the server during an HTTP request. The Request object encapsulates the IRequest interface.

The Request object extends InputStream, the methods of which provide access to the data sent from the client to the server as part of a POST request. You can access the parameters that were provided by the browser in the HTTP request, query string, and so forth, by retrieving one of the five Dictionary objects that the Request object owns with the getServerVariables, getClientCertificate, getForm, getCookies, and getQueryString methods.

public class Request extends InputStream {
    public RequestDictionary getServerVariables();
    public RequestDictionary getClientCertificate();
    public RequestDictionary getForm();
    public CookieDictionary getCookies();
    public RequestDictionary getQueryString();
    public int getTotalBytes();
    // java.io.InputStream Methods
    public int available();
    public void close() throws IOException;
    public synchronized void mark(int iReadLimit);
    public Boolean markSupported();
    public synchronized void reset() throws IOException;
    public long skip(long iNumToSkip) throws IOException;
    public int read() throws IOException,
        NullPointerException,
        IndexOutOfBoundsException;
    public int read(byte[] b) throws IOException,
                                        NullPointerException,
                                        IndexOutOfBoundsException;
    public synchronized int read(byte[] b,
                                 int off,
                                 int len) throws IOException,
                                                 NullPointerException,
                                                 IndexOutOfBoundsException;
}


Request Methods

public RequestDictionary getServerVariables( )

Returns the RequestDictionary that contains the values of predetermined environment variables.  The server variables that can then be retrieved from the dictionary   are:

Variable Description
ALL_HTTP All HTTP headers sent by the client.
ALL_RAW Retrieves all headers in the raw-form. The difference between ALL_RAW and ALL_HTTP is that ALL_HTTP places an HTTP_ prefix before the header name and the header-name is always capitalized. In ALL_RAW the header name and values appear as they are sent by the client.
APPL_MD_PATH Retrieves the metabase path for the (WAM) Application for the ISAPI DLL.
APPL_PHYSICAL_PATH Retrieves the physical path corresponding to the metabase path. IIS converts the APPL_MD_PATH to the physical (directory) path to return this value.
AUTH_PASSWORD Value entered in the client's authentication dialog. This variable is only available if Basic authentication is used.
AUTH_TYPE Authentication method that the server uses to validate users when they attempt to access a protected script.
AUTH_USER Raw authenticated user name
CERT_COOKIE Unique ID for client certificate, returned as a string. Can be used as a signature for the whole client certificate.
CERT_FLAGS bit0 is set to 1 if the client certificate is present.

bit1 is set to 1 if the Certifying Authority of the client certificate is invalid (not in the list of recognized Certifying Authorities on the server).

CERT_ISSUER Issuer field of the client certificate (O=MS, OU=IAS, CN=user name, C=USA).
CERT_KEYSIZE Number of bits in Secure Sockets Layer connection key size; for example, 128.
CERT_SECRETKEYSIZE Number of bits in server certificate private key; for example, 1024.
CERT_SERIALNUMBER Serial number field of the client certificate.
CERT_SERVER_ISSUER Issuer field of the server certificate.
CERT_SERVER_SUBJECT Subject field of the server certificate.
CERT_SUBJECT Subject field of the client certificate.
CONTENT_LENGTH Length of the content as given by the client.
CONTENT_TYPE Data type of the content. Used with queries that have attached information, such as the HTTP queries GET, POST, and PUT.
GATEWAY_INTERFACE Revision of the CGI specification used by the server. The format is CGI/revision.
HTTP_<HeaderName> Value stored in the header HeaderName. Any header other than those listed in this table must be prefixed by HTTP_ in order for the ServerVariables collection to retrieve its value.

Note The server interprets any underscore (_) characters in HeaderName as dashes in the actual header. For example, if you specify HTTP_MY_HEADER, the server searches for a header sent as MY-HEADER.

HTTPS Returns ON if the request came through secure channel (SSL). Returns OFF if the request comes through a non-secure channel.
HTTPS_KEYSIZE Number of bits in Secure Sockets Layer connection key size; for example, 128.
HTTPS_SECRETKEYSIZE Number of bits in server certificate private key; for example, 1024.
HTTPS_SERVER_ISSUER Issuer field of the server certificate.
HTTPS_SERVER_SUBJECT Subject field of the server certificate.
INSTANCE_ID ID for the IIS instance in textual format. If the instance ID is 1, it appears as a string. You can use this variable to retrieve the ID of the Web-server instance (in the metabase) to which the request belongs.
INSTANCE_META_PATH Metabase path for the instance of IIS that responds to the request.
LOCAL_ADDR Returns the Server Address from which the request came. This is important on multi-homed machines where there can be multiple IP addresses bound to a machine and you want to find out which address the request used.
LOGON_USER The Windows NT« account that the user is logged into.
PATH_INFO Extra path information as given by the client. You can access scripts by using the virtual path and the PATH_INFO server variable. If this information comes from a URL, it is decoded by the server before it is passed to the CGI script.
PATH_TRANSLATED Translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping.
QUERY_STRING Query information stored in the string following the question mark (?) in the HTTP request.
REMOTE_ADDR IP address of the remote host making the request.
REMOTE_HOST Name of the host making the request. If the server does not have this information, it will set REMOTE_ADDR and leave this empty.
REMOTE_USER Unmapped user-name string sent in by the User. This is the name that is actually sent by the user, as opposed to names that are modified by any authentication filter installed on the server.
REQUEST_METHOD Method used to make the request. For HTTP, this is GET, HEAD, POST, and so on.
SCRIPT_NAME Virtual path to the script being executed. This is used for self-referencing URLs.
SERVER_NAME Server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.
SERVER_PORT Port number to which the request was sent.
SERVER_PORT_SECURE String that contains either 0 or 1. If the request is being handled on the secure port, then this will be 1. Otherwise, it will be 0.
SERVER_PROTOCOL Name and revision of the request information protocol. The format is protocol/revision.
SERVER_SOFTWARE Name and version of the server software that answers the request and runs the gateway. The format is name/version.
URL Gives the base portion of the URL.

public RequestDictionary getClientCertificate( )

Returns the RequestDictionary that contains the values of fields stored in the client certificate that is sent in the HTTP request.

public RequestDictionary getForm( )

Returns the RequestDictionary that contains the values of form elements in the HTTP request body.

public CookieDictionary getCookies( )

Returns the CookieDictionary that contains the cookies sent in the HTTP request.

public RequestDictionary getQueryString( )

Returns the RequestDictionary that contains the values of variables in the HTTP query string.

public int getTotalBytes( )

Specifies the total number of bytes the client is sending in the body of the request.

java.io.InputStream Methods

public int available( );

Returns the number of bytes available to be read from the stream, without blocking. For more information, see java.io.InputStream.

public void close( ) throws IOException;

Closes the stream. For more information, see java.io.InputStream.

public synchronized void mark(int iReadLimit);

If markSupported returns true, the input stream remembers iReadLimit bytes until a call to reset is made. At that point, those bytes will be returned by one of the read methods. For more information, see java.io.InputStream.

public Boolean markSupported( );

Returns true if the stream supports the mark and reset methods. For more information, see java.io.InputStream.

public synchronized void reset( ) throws IOException;

If markSupported returns true:

For more information, see java.io.InputStream.

public long skip(long iNumToSkip) throws IOException;

Attempts to skip of iNumToSkip bytes of data from the input stream.

For more information, see java.io.InputStream.

public int read( ) throws IOException, NullPointerException, IndexOutOfBoundsException

Reads a single byte from the input stream, returning it as an integer in the range 0 - 255. If no byte is available, -1 is returned.

For more information, see java.io.InputStream.

public int read(byte[ ] b) throws IOException, NullPointerException, IndexOutOfBoundsException

In general, attempts to read some number of bytes from the input stream, and stores the bytes into the buffer b. It returns the actual number of bytes read. If no bytes are available because the stream is at the end of input, -1 is returned.

For more information, see java.io.InputStream..

public synchronized int read(byte[ ] b, int off, int len) throws IOException, NullPointerException, IndexOutOfBoundsException

Attempts to read the number of bytes from the input stream, and stores the bytes in the buffer b, at offset off. Attempts to read len bytes, but may read fewer bytes. The actual number of bytes read is returned. If no bytes are available because the stream is at the end of input, -1 is returned.

For more information, see java.io.InputStream.