getdata middleware
getdata middleware
The getdatamw() middleware will automatically return response.data instead of response, if response.data is set. Response.data will be set by the json middleware, for example, when a response contains json. Usually you should combine this with the thrower middleware, so that network errors will throw an exception.
Usage
Then to send and receive data:
Note that the metro.jsonApi will do all this and some more automatically for you.