Skip to Main Content
Programming Atlas
book

Programming Atlas

by Christian Wenz
September 2006
Intermediate to advanced content levelIntermediate to advanced
408 pages
10h 38m
English
O'Reilly Media, Inc.
Content preview from Programming Atlas

Appendix A. XMLHttpRequest Reference

This Appendix assembles all methods and properties that the XMLHttpRequest object exposes. Square brackets [] denote an array; parentheses () indicate a method.

To create an XMLHttpRequest object for Internet Explorer, you must use ActiveX:

XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");

With other browsers, the XMLHttpRequest object is a built-in type and can be instantiated directly, as in the following snippet:

XMLHTTP = new XMLHttpRequest();

Once the XMLHttpRequest object is instantiated, the following cross-browser methods and properties are supported:.

Methods

Method

Description

abort()

Aborts the request

getAllResponseHeaders()

Returns all headers of the HTTP response

getResponseHeader(header)

Returns the value of the given HTTP response header

open(method, url, async, username, password)

Creates an HTTP request with the given method (GET or POST) to the given URL. The other parameters are optional: whether to use an asynchronous call (default) or not, and credentials for HTTP Authentication

send(content)

Sends the HTTP request, optionally providing data to send with it (POST information)

setRequestHeader(name, value)

Adds a header with the given name and value to the HTTP request

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Go Systems Programming

Go Systems Programming

Mihalis Tsoukalos

Publisher Resources

ISBN: 0596526725Supplemental ContentCatalog PageErrata