DS.RESTAdapter#normalizeErrorResponse()

normalizeErrorResponse (status, headers, payload) Arrayprivate Defined in addon/adapters/rest.js:1104 Parameters: status Number headers Object payload Object Returns: Array errors payload

DS.RESTAdapter#namespace

namespace{String} Defined in addon/adapters/rest.js:349 Endpoint paths can be prefixed with a namespace by setting the namespace property on the adapter: app/adapters/application.js import DS from 'ember-data'; export default DS.RESTAdapter.extend({ namespace: 'api/1' }); Requests for the Post model would now target /api/1/post/.

DS.RESTAdapter#methodForRequest()

methodForRequest (params) Stringpublic Defined in addon/adapters/rest.js:1254 Get the HTTP method for a request. Parameters: params Object Returns: String HTTP method

DS.RESTAdapter#isSuccess()

isSuccess (status, headers, payload) Boolean Defined in addon/adapters/rest.js:945 Available since 1.13.0 Default handleResponse implementation uses this hook to decide if the response is a success. Parameters: status Number headers Object payload Object Returns: Boolean

DS.RESTAdapter#isInvalid()

isInvalid (status, headers, payload) Boolean Defined in addon/adapters/rest.js:960 Available since 1.13.0 Default handleResponse implementation uses this hook to decide if the response is a an invalid error. Parameters: status Number headers Object payload Object Returns: Boolean

DS.RESTAdapter#host

host{String} Defined in addon/adapters/rest.js:367 An adapter can target other hosts by setting the host property. app/adapters/application.js import DS from 'ember-data'; export default DS.RESTAdapter.extend({ host: 'https://api.example.com' }); Requests for the Post model would now target https://api.example.com/post/.

DS.RESTAdapter#headersForRequest()

headersForRequest (params) Objectpublic Defined in addon/adapters/rest.js:1311 Get the headers for a request. By default the value of the headers property of the adapter is returned. Parameters: params Object Returns: Object headers

DS.RESTAdapter#headers

headers{Object} Defined in addon/adapters/rest.js:384 Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary headers can be set as key/value pairs on the RESTAdapter's headers object and Ember Data will send them along with each ajax request. For dynamic headers see headers customization. app/adapters/application.js import DS from 'ember-data'; export default DS.RESTAdapter.extend({ headers: { "API_KEY": "secret key", "ANOTHER_HEADER": "Some header value" } });

DS.RESTAdapter#handleResponse()

handleResponse (status, headers, payload, requestData) Object | DS.AdapterError Defined in addon/adapters/rest.js:886 Available since 1.13.0 Takes an ajax response, and returns the json payload or an error. By default this hook just returns the json payload passed to it. You might want to override it in two cases: Your API might return useful results in the response headers. Response headers are passed in as the second argument. Your API might return errors as successful responses with stat

DS.RESTAdapter#groupRecordsForFindMany()

groupRecordsForFindMany (store, snapshots) Array Inherited from DS.Adapter but overwritten in addon/adapters/rest.js:822 Organize records into groups, each of which is to be passed to separate calls to findMany. This implementation groups together records that have the same base URL but differing ids. For example /comments/1 and /comments/2 will be grouped together because we know findMany can coalesce them together as /comments?ids[]=1&ids[]=2 It also supports urls where ids are passed