Creates an observable sequence from an Ajax POST Request with the body. This is just a shortcut to the Rx.DOM.ajax method with the POST method.
url(String): A string of the URL to make the Ajax call.[body](Object): The body to post
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.
(Observable): The observable sequence which contains the response from the Ajax POST.
Rx.DOM.post('/test', { text: 'sometext' })
.subscribe(
function (data) {
console.log(data.response);
},
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: