Boolean indicating if the request is asynchronous.
Boolean indicating if the request is binary. This option is ignored in IE. In all other browsers the requested mime type is set to text/plain; charset=x-user-defined. Default is false.
Specifies if request values should be decoded as URIs before setting the textarea value in simulate. Defaults to false for backwards compatibility, to avoid another decode on the server this should be set to true.
Specifies the request method. Possible values are POST and GET. Default is POST.
Holds the form encoded data for the POST request.
Specifies the password to be used for authentication.
Holds the inner, browser-specific request object.
Holds the target URL of the request.
Specifies the username to be used for authentication.
Specifies if withCredentials should be used in HTML5-compliant browsers. Default is false.
Creates and returns the inner request object.
Returns the response as an XML document. Use getDocumentElement to get the document element of the XML document.
Returns binary.
Send the
Note: Due to technical limitations, onerror is currently ignored.
Function to be invoked if a successful response was received.
Function to be called on any error. Unused in this implementation, intended for overriden function.
Optional timeout in ms before calling ontimeout.
Optional function to execute on timeout.
Sets binary.
Sets the headers for the given request and parameters. This sets the content-type to application/x-www-form-urlencoded if any params exist.
request.setRequestHeaders = function(request, params)
{
if (params != null)
{
request.setRequestHeader('Content-Type',
'multipart/form-data');
request.setRequestHeader('Content-Length',
params.length);
}
};
Use the code above before calling send if you require a multipart/form-data request.
XML HTTP request wrapper. See also: mxUtils.get, mxUtils.post and mxUtils.load. This class provides a cross-browser abstraction for Ajax requests.
Encoding:
For encoding parameter values, the built-in encodeURIComponent JavaScript method must be used. For automatic encoding of post data in Editor the Editor.escapePostData switch can be set to true (default). The encoding will be carried out using the conte type of the page. That is, the page containting the editor should contain a meta tag in the header, eg.
Example
Sends an asynchronous POST request to the specified URL.
Example
Sends a synchronous POST request to the specified URL.
Example
Sends an encoded graph model to the specified URL using xml as the parameter name. The parameter can then be retrieved in C# as follows:
Or in Java as follows:
Note that the linefeeds should only be replaced if the XML is processed in Java, for example when creating an image.