ajax (url, type, options) Promise
private
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 theContent-Type
to beapplication/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
Please login to continue.