Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Latest commit

 

History

History
62 lines (48 loc) · 2.44 KB

get.md

File metadata and controls

62 lines (48 loc) · 2.44 KB

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 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 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:

NPM Packages:

NuGet Packages:

Unit Tests: