diff --git a/CHANGELOG.md b/CHANGELOG.md index 3632e0c8d4..c802ccfb5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,17 +9,21 @@ Fixes and Functionality: - Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama - Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester - Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers -- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel -- Consistent coding style ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez - Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov - This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` - Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson - Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi - Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel - Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse Documentation: +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez - Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna - Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho - Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan @@ -30,7 +34,6 @@ Documentation: - Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher - docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe - It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser -- Add issue templates - Emily Morehouse - Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko - Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan - Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer diff --git a/COOKBOOK.md b/COOKBOOK.md index 3e719b4f57..3f4debd3a5 100644 --- a/COOKBOOK.md +++ b/COOKBOOK.md @@ -1,8 +1,8 @@ # Cookbook -In an effort to keep axios as light weight as possible, and to avoid a rats nest of code for supporting every possible integration, it is often necessary to say no to feature requests. This doesn't mean that those use cases aren't legitimate, but rather that they are easily supported by augmenting axios with other libraries. +This cookbook contains recipes for some commonly requested features. -The following are the recipes for some of the commonly requested features. +In order to keep axios as lightweight as possible, it is often necessary to say no to feature requests. Many of these use cases can be supported by augmenting axios with other libraries. ### Promise.prototype.done diff --git a/ECOSYSTEM.md b/ECOSYSTEM.md index 77bf978dae..b9595d28da 100644 --- a/ECOSYSTEM.md +++ b/ECOSYSTEM.md @@ -4,23 +4,34 @@ This is a list of axios related libraries and resources. If you have a suggestio ## Libraries -* [react-hooks-axios](https://github.com/use-hooks/react-hooks-axios) - Custom React Hooks for Axios.js -* [moxios](https://github.com/axios/moxios) - Mock axios requests for testing -* [axios-response-logger](https://github.com/srph/axios-response-logger) - Axios interceptor which logs responses -* [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) — Axios adapter that allows to easily mock requests -* [redux-axios-middleware](https://github.com/svrcekmichal/redux-axios-middleware) - Redux middleware for fetching data with axios HTTP client +### General + * [axios-vcr](https://github.com/nettofarah/axios-vcr) - 📼 Record and Replay Axios requests * [@3846masa/axios-cookiejar-support](https://github.com/3846masa/axios-cookiejar-support) - Add tough-cookie support to axios -* [axios-debug-log](https://github.com/Gerhut/axios-debug-log) - Axios interceptor of logging requests & responses by debug. * [axios-method-override](https://github.com/jacobbuck/axios-method-override) - Axios http request method override plugin -* [mocha-axios](https://github.com/jdrydn/mocha-axios) - Streamlined integration testing with Mocha & Axios -* [axiosist](https://github.com/Gerhut/axiosist) - Axios based supertest: convert node.js request handler to axios adapter, used for node.js server unit test. * [axios-cache-plugin](https://github.com/jin5354/axios-cache-plugin) - Help you cache GET request when using axios. * [axios-extensions](https://github.com/kuitos/axios-extensions) - A collection of axios extensions, including throttle and cache GET request plugin. -* [redux-saga-requests](https://github.com/klis87/redux-saga-requests) - Redux-Saga addon to simplify handling of AJAX requests. * [axios-fetch](https://github.com/lifeomic/axios-fetch) - A WebAPI Fetch implementation backed by an Axios client -* [axios-curlirize](https://www.npmjs.com/package/axios-curlirize) - Logs axios requests as curl commands, also adds a property to the response object with the curl command as value. * [axios-actions](https://github.com/davestewart/axios-actions) - Bundle endpoints as callable, reusable services * [axios-api-versioning](https://weffe.github.io/axios-api-versioning) - Add easy to manage api versioning to axios * [r2curl](https://github.com/uyu423/r2curl) - Extracts the cURL command string from the Axios object. (AxiosResponse, AxiosRequestConfig) * [axios-endpoints](https://github.com/renancaraujo/axios-endpoints) - Axios endpoints helps you to create a more concise endpoint mapping with axios. + +### Logging and debugging + +* [axios-response-logger](https://github.com/srph/axios-response-logger) - Axios interceptor which logs responses +* [axios-debug-log](https://github.com/Gerhut/axios-debug-log) - Axios interceptor of logging requests & responses by debug. +* [axios-curlirize](https://www.npmjs.com/package/axios-curlirize) - Logs axios requests as curl commands, also adds a property to the response object with the curl command as value. + +### React and redux + +* [react-hooks-axios](https://github.com/use-hooks/react-hooks-axios) - Custom React Hooks for Axios.js +* [redux-saga-requests](https://github.com/klis87/redux-saga-requests) - Redux-Saga addon to simplify handling of AJAX requests. +* [redux-axios-middleware](https://github.com/svrcekmichal/redux-axios-middleware) - Redux middleware for fetching data with axios HTTP client + +### Unit testing + +* [axiosist](https://github.com/Gerhut/axiosist) - Axios based supertest: convert node.js request handler to axios adapter, used for node.js server unit test. +* [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) — Axios adapter that allows to easily mock requests +* [moxios](https://github.com/axios/moxios) - Mock axios requests for testing +* [mocha-axios](https://github.com/jdrydn/mocha-axios) - Streamlined integration testing with Mocha & Axios \ No newline at end of file diff --git a/README.md b/README.md index f17e2a5b5d..3c7d721f28 100755 --- a/README.md +++ b/README.md @@ -538,7 +538,7 @@ axios.get('/user/12345') }); ``` -You can define a custom HTTP status code error range using the `validateStatus` config option. +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. ```js axios.get('/user/12345', { diff --git a/examples/all/index.html b/examples/all/index.html index 4e817dbe27..caaafdcf19 100644 --- a/examples/all/index.html +++ b/examples/all/index.html @@ -2,7 +2,7 @@ axios - all example - +

axios.all

diff --git a/examples/amd/index.html b/examples/amd/index.html index 60471d2848..1b10d2be8c 100644 --- a/examples/amd/index.html +++ b/examples/amd/index.html @@ -2,7 +2,7 @@ AMD - +

AMD

diff --git a/examples/get/index.html b/examples/get/index.html index dc8e51b1e5..86433235a3 100644 --- a/examples/get/index.html +++ b/examples/get/index.html @@ -2,7 +2,7 @@ axios - get example - +

axios.get

diff --git a/examples/post/index.html b/examples/post/index.html index 11f9ce3bd1..43914a1138 100644 --- a/examples/post/index.html +++ b/examples/post/index.html @@ -2,7 +2,7 @@ axios - post example - +

axios.post

diff --git a/examples/server.js b/examples/server.js index 525fb63339..dab1c04006 100644 --- a/examples/server.js +++ b/examples/server.js @@ -1,5 +1,4 @@ var fs = require('fs'); -var url = require('url'); var path = require('path'); var http = require('http'); var argv = require('minimist')(process.argv.slice(2)); @@ -10,7 +9,7 @@ function listDirs(root) { var files = fs.readdirSync(root); var dirs = []; - for (var i=0, l=files.length; i /get/index.html var parts = url.split('/'); if (dirs.indexOf(parts[parts.length - 1]) > -1) { @@ -134,4 +133,8 @@ server = http.createServer(function (req, res) { } }); -server.listen(argv.p || 3000); +const PORT = argv.p || 3000; + +server.listen(PORT); + +console.log("Examples running on " + PORT); diff --git a/examples/transform-response/index.html b/examples/transform-response/index.html index be95d2cdf6..36dd26a166 100644 --- a/examples/transform-response/index.html +++ b/examples/transform-response/index.html @@ -2,7 +2,7 @@ axios - transform response example - +

transformResponse

diff --git a/examples/upload/index.html b/examples/upload/index.html index f34386f9c1..c26b41fb69 100644 --- a/examples/upload/index.html +++ b/examples/upload/index.html @@ -2,7 +2,7 @@ axios - file upload example - +

file upload

diff --git a/sandbox/client.html b/sandbox/client.html index ee59ad8c9f..55051c2ea0 100644 --- a/sandbox/client.html +++ b/sandbox/client.html @@ -2,7 +2,7 @@ axios - +