A generic wrapper to hide the complexities and API-specifics of the native XMLHTTP control for a given browser.
Developers wishing to create/modify XML documents can use this class to access common XMLHTTP methods.
Note that when using this interface to post xml content to a server, the called server may expect the content
type to be set for the posting. For example,
objRequest.setRequestHeader("Content-Type", "text/xml");
| Method Summary |
|---|
| jsx3.net.Request | Aborts the request. |
| static void | Deprecated. Use abort() instead. |
| String | Gets the value of all the HTTP headers. |
| int | Deprecated. This method is not consistent between browsers. Use the event publisher interface instead to track
the state of the request.
|
| static jsx3.net.Request | Deprecated. Static access to pending requests by id is deprecated.
|
| String | Gets the value of a specific HTTP response header. |
| String | Gets the content of the response as string. |
| jsx3.xml.Document | Gets the content of the response as an XML document. |
| int | Gets the HTTP response code (e.g. |
| String | Gets the HTTP response line status (e.g. |
| String | Gets the URL passed when opening this request. |
| static String | |
| jsx3.net.Request | Initializes the request, and specifies the method, URL, and authentication information for the request. |
| jsx3.net.Request | Sends the request. |
| jsx3.net.Request | Sets the value of a specific HTTP request header. |
| jsx3.net.Request | |
Event type published when the response has loaded.
Event type published when the server has not responded after the specified timeout period.
The instance initializer.
Parameters:
id – If the call will be asynchronous, assigns a unique identifier.
Deprecated. Use abort() instead.
Cancels the named request.
Parameters:
strRequestId – named id for the request (assigned by developer when the Request was instanced);
See Also:
Gets the value of all the HTTP headers.
Returns:
Deprecated. This method is not consistent between browsers. Use the event publisher interface instead to track
the state of the request.
Gets the ready state for the request; return values include:
0) The object has been created, but not initialized (the open method has not been called).
1) The object has been created, but the send method has not been called.
2) The send method has been called, but the status and headers are not yet available.
3) Some data has been received. Calling the responseBody and responseText properties at this state to obtain partial results will return an error, because status and response headers are not fully available.
4) All the data has been received, and the complete data is available via the getResponseText()/getResponseXML() methods
Returns:
Deprecated. Static access to pending requests by id is deprecated.
Gets the named request instance.
Parameters:
strRequestId – named id for the request (assigned by developer when the Request was instanced);
Returns:
Gets the value of a specific HTTP response header.
Parameters:
strName – the name for the response header to retrieve.
Returns:
Gets the content of the response as string.
Returns:
Gets the content of the response as an XML document. If the response is not a valid XML document,
null is returned.
Returns:
Gets the HTTP response code (e.g. 200, 404, 500, etc).
Returns:
Gets the HTTP response line status (e.g. "OK").
Returns:
Gets the URL passed when opening this request.
Returns:
Deprecated.
gets the release/build for the class (i.e., "3.0.00")
Returns:
Initializes the request, and specifies the method, URL, and authentication information for the request.
Parameters:
strMethod – The HTTP method used to open the connection. Valid values include: GET, POST, or PUT.
strURL – The requested URL. This can be either an absolute URL, such as "http://www.TIBCO.com", or a relative URL, such as "../MyPath/MyFile".
bAsync – whether to issue the request asynchronously, if true this class will use the EventDispatcher interface to publish an event on response or timeout.
strUser – The name of the user for authentication. If this parameter is null ("") or missing and the site requires authentication, the native HTTP control will display a logon window.
strPass – The password for authentication. This parameter is ignored if the user parameter is null ("") or missing.
Returns:
this object.
Sends the request.
Parameters:
strContent – The content to send for a POST request.
intTimeout – the number milliseconds to wait before publishing a timeout event. This only applies
to asynchronous requests. If used, subscribe to the jsx3.net.Request.EVENT_ON_TIMEOUT event to
be notified of a timeout.
Returns:
this object.
Sets the value of a specific HTTP request header. The open() method should be called before calling
this method.
Parameters:
strName – the name for the request header to send to the server with the request content.
strValue – the value for the request header to send to the server with the request content.
Returns:
this object.
Deprecated. IE only.
Specifies timeout settings for resolving the domain name, establishing the connection to the server, sending the data, and receiving the response. The timeout parameters of the setTimeouts method are specified in milliseconds, so a value of 1000 would represent 1 second. A value of zero represents an infinite timeout. There are four separate timeout parameters: resolveTimeout, connectTimeout, sendTimeout, and receiveTimeout. When calling the setTimeouts method, all four values must be specified. The timeouts are applied at the Winsock layer.
Parameters:
intResolveTimeout – The value is applied to mapping host names (such as "www.microsoft.com") to IP addresses; the default value is infinite, meaning no timeout.
intConnectTimeout – The value is applied to establishing a communication socket with the target server, with a default timeout value of 60 seconds.
intSendTimeout – The value applies to sending an individual packet of request data (if any) on the communication socket to the target server. A large request sent to a server will normally be broken up into multiple packets; the send timeout applies to sending each packet individually. The default value is 5 minutes.
intReceiveTimeout – The value applies to receiving a packet of response data from the target server. Large responses will be broken up into multiple packets; the receive timeout applies to fetching each packet of data off the socket. The default value is 60 minutes.
Returns:
this instance.
Copyright © 2001-2007, TIBCO Software Inc.