What are the important methods of XMLHttpRequest?

What are the important methods of XMLHttpRequest?

The important methods of XMLHttpRequest are:

  • Abort()

Cancel the current request.

  • GetAllResponseHeaders()

It returns the headers as a string.

  • GetResponseHeader()

It returns the specified header information.

  • Open(method,url,async,uname,pswd)

It specifies the request, URL and other optional attributes of a request.
The method parameter can have a value of "GET" or "POST".
The URL specifies the location of the file on the server.
The async specifies whether the request should be handled asynchronously or not. True means asynchronous and false means synchronous while handling the request.

  • Send(string)

It sends the request to the server.

  • SetRequestHeader()

Adds a label/value pair to the header which is to be sent

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.