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.
Value Meaning - 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
- XMLHttpRequest, Section 3.6.3
- XMLHttpRequest, Section 4.7.6
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).
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