Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 2.48 KB

post.md

File metadata and controls

63 lines (48 loc) · 2.48 KB

Rx.DOM.post(url, [body])

Rx.DOM.post(settings)

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.

Arguments

  • 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 is true.
    • body (Object): Optional body
    • crossDomain (Boolean): true if to use CORS, else false. The default is false.
    • headers (Object): Optional headers
    • password (String): The password for the request.
    • progressObserver (Observer): An optional Observer 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 request
    • user (String): The user for the request.

Returns

(Observable): The observable sequence which contains the response from the Ajax POST.

Example

Rx.DOM.post('/test', { text: 'sometext' })
  .subscribe(
    function (data) {
      console.log(data.response);
    },
    function (err) {
      // Log the error
    }
  );

Location

File:

Dist:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests: