From 8c3fc8fa8a7427613165af6fc9542c0cc4ff09b7 Mon Sep 17 00:00:00 2001 From: mzabriskie Date: Mon, 29 Sep 2014 22:41:49 -0600 Subject: [PATCH] Updating README --- README.md | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index cef4529..9843757 100644 --- a/README.md +++ b/README.md @@ -73,18 +73,6 @@ axios.post('/user', { }); ``` -Aliases are provided for success and error - -```js -axios.get('/user/12345') - .success(function () { - console.log('user found'); - }) - .error(function () { - console.log('error finding user'); - }); -``` - Performing multiple concurrent requests ```js @@ -158,7 +146,7 @@ This is the available config options for making requests. Only the `url` is requ }], // `transformResponse` allows changes to the response data to be made before - // it is passed to the success/error handlers + // it is passed to then/catch transformResponse: [function (data) { // Do whatever you want to transform the data @@ -216,7 +204,7 @@ The response for a request contains the following information. } ``` -When using `then` or `catch`, you will receive a single response object. +When using `then` or `catch`, you will receive the response as follows: ```js axios.get('/user/12345') @@ -228,19 +216,6 @@ axios.get('/user/12345') }); ``` -For either `success` or `error`, the response is broken up into individual arguments. - -```js -axios.get('/user/12345') - .success(function (data, status, headers, config) { - console.log(data); - console.log(status); - console.log(headers); - console.log(config); - }); -} -``` - ## Credits axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular.