Skip to content
This repository was archived by the owner on Feb 9, 2021. It is now read-only.

Response

Darko Kukovec edited this page Jun 24, 2017 · 1 revision

constructor

constructor(response: IRawResponse, store: Store, options?: IRequestOptions, overrideData?: IModel|Array<IModel>)

Creates a new Response object instance. It needs to receive at lest the raw response and the store instance.

replaceData

replaceData(data: IModel): Response

Replace the response record with a different record. Used to replace a record while keeping the same reference. Mostly for internal use.

data

An record or an array of records received from the API

error

An error object received from the API

jsonapi

The JSON API version received from the API

meta

Metadata received in the API response (not including the record or relationship meta data)

links

Links received in the API response. The link promises are exposed as properties of the Response object. The promise will resolve to a different Response object. The properties are lazy evaluated, so no requests will be done unless you access the property.

headers

A Headers object returned from the API

requestHeaders

A key/value object with custom headers sent to the server in the API call

status

HTTP response status

Clone this wiki locally