DS.RESTAdapter#ajax()

ajax (url, type, options) Promiseprivate

Defined in addon/adapters/rest.js:975

Takes a URL, an HTTP method and a hash of data, and makes an HTTP request.

When the server responds with a payload, Ember Data will call into extractSingle or extractArray (depending on whether the original query was for one record or many records).

By default, ajax method has the following behavior:

  • It sets the response dataType to "json"
  • If the HTTP method is not "GET", it sets the Content-Type to be application/json; charset=utf-8
  • If the HTTP method is not "GET", it stringifies the data passed in. The data is the serialized record in the case of a save.
  • Registers success and failure handlers.

Parameters:

url String
type String
The request type GET, POST, PUT, DELETE etc.
options Object

Returns:

Promise
promise
doc_EmberJs
2016-11-30 16:50:26
Comments
Leave a Comment

Please login to continue.