Class HTTPRequest
- All Implemented Interfaces:
Serializable,CGIConstants
- Direct Known Subclasses:
HTTPRequestImpl
Client-side Serialization The client (HTTP gateway) constructs request objects to carry request information to a method server. The client stores the available HTTP request information in the object and sets the input stream reference to the actual HTTP request's input stream provided by the Web server.
Serialization of the object sends the request information followed by the content of the input stream. The content is forwarded by reading blocks of data from the input stream and writing them to the marshal stream until the entire body has been sent. The length of the body is determined from the content-length HTTP header. If no content-length is specified, it reads until EOF on the input stream.
Server-side Deserialization
The server (Windchill method server) receives the request object as
an argument to an RMI call. It is deserialized before the target
method is invoked. The deserialization code stores a reference to
the RMI marshal stream in the object and directly dispatches the target
method (HTTPServer.processRequest) prematurely. The body of the request
is then available as an input stream to the dispatched method. The
RMI marshal stream is simply being used as a pipe to connect the
input stream provided to the HTTP gateway by the Web server to an
input stream in the Windchill method server.
Supported API: true
Extendable: false
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionabstract StringDetermine the Base URL of this script.Guess user agent's file encoding from request headers.Retrieves the FORM data from the incoming input stream as x-www-form-urlencoded data.Retrieves the FORM data from the incoming input stream as x-www-form-urlencoded data.abstract HashtablegetFormDataMultivalue(String encoding) Retrieves the FORM data from the incoming input stream as x-www-form-urlencoded data.abstract StringDetermine the Full URL of this script.abstract StringgetProperty(String key) Public getter method for access to CGI data.abstract StringgetProperty(String key, String default_value) Public getter method for access to CGI data.abstract EnumerationPublic getter method for access to CGI data keys.abstract StringGets the URLs query string in decoded format.abstract StringgetQueryString(String encoding) Gets the URLs query string in decoded format.abstract booleanDetermine if the REQUEST_METHOD used to send the data from the browser was the GET method.abstract booleanDetermine if the REQUEST_METHOD used to send the data from the browser was the POST method.abstract booleanDetermine if the CONTENT_TYPE used to send the data from the browser was urlencoded form data.abstract voidSets the FORM data from a saved session.abstract voidsetProperty(String key, String value) Public setter method for CGI data.abstract PropertiesSplits the URLs query string into name value pairs based on the ampersand and equal character tokens.static PropertiessplitQueryString(String query_string) Splits the given query string into name value pairs based on the ampersand and equal character tokens.static PropertiessplitQueryString(String query_string, String encoding) Splits the URLs query string into name value pairs based on the ampersand and equal character tokens.abstract HashtableSplits the URLs query string into name value pairs based on the ampersand and equal character tokens.static HashtablesplitQueryStringMultivalue(String query_string) Splits the given query string into name value pairs based on the ampersand and equal character tokens.static HashtablesplitQueryStringMultivalue(String query_string, String encoding) Splits the URLs query string into name value pairs based on the ampersand and equal character tokens.
-
Method Details
-
getFormData
Retrieves the FORM data from the incoming input stream as x-www-form-urlencoded data. If the input stream is null, it will read FORM data from the header query string. All hex escaped characters are decoded, then the sequence of 8-bit values is converted to characters using the character encoding returned bygetEncoding.
Supported API: true- Returns:
- the form data as name value pairs
-
setFormData
Sets the FORM data from a saved session.
Supported API: true- Parameters:
p- the form data
-
getFormDataMultivalue
Retrieves the FORM data from the incoming input stream as x-www-form-urlencoded data. If the input stream is null, it will read FORM data from the header query string. All hex escaped characters are decoded, then the sequence of 8-bit values is converted to characters using the character encoding returned bygetEncoding. Multivalue fields are stored in a Vector which can be iterated for the individual values.
Supported API: true- Returns:
- Properties the form data as name value pairs.
-
getFormDataMultivalue
Retrieves the FORM data from the incoming input stream as x-www-form-urlencoded data. If the input stream is null, it will read FORM data from the header query string. All hex escaped characters are decoded, then the sequence of 8-bit values is converted to characters using the given character encoding. Multivalue fields are stored in a Vector which can be iterated for the individual values.
Supported API: true- Parameters:
encoding- the encoding to use- Returns:
- the form data as name value pairs.
-
getQueryString
Gets the URLs query string in decoded format. All hex escaped characters are decoded. The sequence of 8-bit values is then converted to characters using UTF8 encoding.
Supported API: true- Returns:
- the decoded query string.
-
getQueryString
Gets the URLs query string in decoded format. All hex escaped characters are decoded. The sequence of 8-bit values is then converted to characters using the given character encoding.
Supported API: true- Parameters:
encoding- the encoding to use- Returns:
- the decoded query string.
-
splitQueryString
Splits the URLs query string into name value pairs based on the ampersand and equal character tokens. The returned properties are URL decoded and then converted to characters using UTF8 encoding.
Supported API: true- Returns:
- the query string info as name value pairs.
-
splitQueryStringMultivalue
Splits the URLs query string into name value pairs based on the ampersand and equal character tokens. The returned properties are URL decoded and then converted to characters using UTF8 encoding.
Supported API: true- Returns:
- the query string info as name value pairs.
-
splitQueryString
Splits the given query string into name value pairs based on the ampersand and equal character tokens. The string should not yet be URL decoded, since some of the names or values might themselves contain the ampersand and equal characters. The returned properties are URL decoded and then converted to characters using UTF8 encoding.
Supported API: true- Parameters:
query_string- the query string.- Returns:
- the query string info as name value pairs.
-
splitQueryStringMultivalue
Splits the given query string into name value pairs based on the ampersand and equal character tokens. The string should not yet be URL decoded, since some of the names or values might themselves contain the ampersand and equal characters. The returned properties are URL decoded and then converted to characters using UTF8 encoding.
Supported API: true- Parameters:
query_string- the query string.- Returns:
- the query string info as name value pairs.
-
splitQueryString
Splits the URLs query string into name value pairs based on the ampersand and equal character tokens. The string should not yet be URL decoded, since some of the names or values might themselves contain the ampersand and equal characters. The returned properties are URL decoded and then converted to characters using the given encoding. Non-string values (ie Multivalue parameters are stored in vector) are converted to a toString() format.
Supported API: true- Parameters:
query_string- the query string.encoding- the character encoding name- Returns:
- the query string info as name value pairs.
-
splitQueryStringMultivalue
Splits the URLs query string into name value pairs based on the ampersand and equal character tokens. The string should not yet be URL decoded, since some of the names or values might themselves contain the ampersand and equal characters. The returned properties are URL decoded and then converted to characters using the given encoding. Multivalue parameters are stored in a vector which can be iterated for the individual values.
Supported API: true- Parameters:
query_string- the query string.encoding- the character encoding name- Returns:
- the query string info as name value pairs.
-
isGetRequest
public abstract boolean isGetRequest()Determine if the REQUEST_METHOD used to send the data from the browser was the GET method.
Supported API: true- Returns:
- true, if the REQUEST_METHOD was GET. false, otherwise.
-
isPostRequest
public abstract boolean isPostRequest()Determine if the REQUEST_METHOD used to send the data from the browser was the POST method.
Supported API: true- Returns:
- true, if the REQUEST_METHOD was POST. false, otherwise.
-
isUrlencodedContent
public abstract boolean isUrlencodedContent()Determine if the CONTENT_TYPE used to send the data from the browser was urlencoded form data.
Supported API: true- Returns:
- true, if the CONTENT_TYPE was urlencoded form data. false, otherwise.
-
getBaseURL
Determine the Base URL of this script. (Does not include the QUERY_STRING (if any) or PATH_INFO (if any).
Supported API: true- Returns:
- The base URL of this script as a String.
-
getFullURL
Determine the Full URL of this script. (Includes the QUERY_STRING (if any) or PATH_INFO (if any).
Supported API: true- Returns:
- The full URL of this script as a String.
-
getProperty
Public getter method for access to CGI data.
Supported API: true- Parameters:
key- the key of interest- Returns:
- the value
-
getPropertyKeys
Public getter method for access to CGI data keys.
Supported API: true- Returns:
- Enumeration of the keys
-
getProperty
Public getter method for access to CGI data. If not set, default value is returned.
Supported API: true- Parameters:
key- the key of interestdefault_value- the default value to return- Returns:
- the value
-
setProperty
Public setter method for CGI data.
Supported API: true- Parameters:
key- the key of interestvalue- the value
-
getEncoding
Guess user agent's file encoding from request headers. If Accept-Charset is specified, use the first value and apply a mapping of IANA names to Java encoding names. Mapping can be controlled at runtime with properties of the formwt.httpgw.encoding.xxx=yyywherexxxis the lower case IANA encoding name andyyyis the Java encoding name. If no Accept-Charset header is present, use template encoding rules to guess.
Supported API: true- Returns:
- the encoding name
-