Rx.DOM.Request.ajax(url | settings)

# [Ⓣ][1]

Creates a hot observable for an Ajax request with either a settings object with url, headers, etc or a string for a URL.


  1. url (String): A string of the URL to make the Ajax call.
  2. settings (Object): An object with the following properties

     - `url` *(String)*: URL of the request
       - `method` *(String)*: Method of the request, such as GET, POST, PUT, PATCH, DELETE
       - `async` *(Boolean)*: Whether the request is async
       - `headers` *(Object)*: Optional headers


(Observable): An observable sequence containing the XMLHttpRequest.


The following example uses a simple URL to retrieve a list of products.

        function (xhr) {

            var products = JSON.parse(xhr.responseText);

            products.forEach(function (product) {
        function (error) {
            // Log the error