get.md
October 9, 2015 · View on GitHub
Rx.DOM.ajax.get(url)`
Rx.DOM.ajax.get(settings)`
Creates an observable sequence from an Ajax GET Request with the body. This is just a shortcut to the Rx.DOM.ajax method with the GET method.
Arguments
url(String): A string of the URL to make the Ajax call.
OR
-
settings(Object): An object with the following properties:async(Boolean): Whether the request is async. The default istrue.body(Object): Optional bodycrossDomain(Boolean): true if to use CORS, else false. The default isfalse.headers(Object): Optional headerspassword(String): The password for the request.progressObserver(Observer): An optionalObserverwhich listen to XHR2 progress events.responseType(String): The response type. Either can be 'json' or 'text'. The default is 'text'url(String): URL of the requestuser(String): The user for the request.
Returns
(Observable): The observable sequence which contains the response from the Ajax GET.
Example
Rx.DOM.get('/products')
.subscribe(
function (data) {
var text = data.response;
console.log(text);
},
function (err) {
// Log the error
}
);
Location
File:
Dist:
Prerequisites:
- If using
rx.js rx.lite.js|rx.lite.compat.js
NPM Packages:
NuGet Packages:
Unit Tests: