EN
本內容沒有您的語言版本,但有英文版本。

send method

Sends an HTTP request to the server and receives a response.

Syntax

XMLHttpRequest.send(varBody);

Parameters

varBody [in, optional]

Type: any

Any that specifies the body of the message being sent with the request.

ValueMeaning
ArrayBuffer

A binary data. See FileReader.readAsArrayBuffer.

blob

A Blob (binary data object).

Document

A documentnode.

ArrayBufferView

A typed array view of an ArrayBuffer.

string

A DOMString.

FormData

A FormData object.

 

Return value

This method does not return a value.

Standards information

Remarks

send was introduced in Windows Internet Explorer 7.

This method is synchronous or asynchronous, depending on the value of the varAsync parameter in the open method call. If synchronous, this call does not return until the entire response is received or the protocol stack time out period expires. If asynchronous, this call returns immediately.

This optional varBody parameter may be a String, array of unsigned bytes, or an XML Document Object Model (DOM) object. For additional information, see send Method (IXMLHTTPRequest).

Warning  It is now possible to use XMLHttpRequest to upload extremely large objects, such as Blob objects and FormData objects, which may take a long time to complete. Because Windows Store apps using JavaScript can be terminated at any time, there is a risk the upload will not complete. Consider using the Windows Runtime file upload APIs, such as BackgroundTransfer, for these operations. For more information, see Quickstart: Uploading a file.

An ArrayBufferView is a typed array view of an ArrayBuffer. Introduced in Internet Explorer 10, an ArrayBuffer is a unformatted block of raw data that is sent in its entirety to a server. By using a typed array to define the format of the buffer, and the start and length (number of elements), you can send portions of an ArrayBuffer to a server.

See also

XMLHttpRequest
Reference
open
setRequestHeader

 

 

顯示:
© 2014 Microsoft