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.
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 optionalObserver
which 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.
(Observable): The observable sequence which contains the response from the Ajax GET.
Rx.DOM.get('/products')
.subscribe(
function (data) {
var text = data.response;
console.log(text);
},
function (err) {
// Log the error
}
);
File:
Dist:
Prerequisites:
- If using
rx.js
rx.lite.js
|rx.lite.compat.js
NPM Packages:
NuGet Packages:
Unit Tests: