2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-27 14:47:43 +03:00
Commit Graph

61 Commits

Author SHA1 Message Date
Dmitriy Mozgovoy c008e57fe4 Added axios.formToJSON method; (#4735)
* Draft

* Added `formDataToJSON` helper;
Added `axios.formToJSON` method;
Added client tests;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-25 08:21:40 +02:00
Jay 8699891b8e Fixed merge conflicts 2022-04-01 18:40:12 +02:00
Dmitriy Mozgovoy 6b9b05b907 Improved FormData support; (#4448)
* Fixed isFormData predicate;
Added support for automatic object serialization to FormData if `Content-Type` is `multipart/form-data`;
Added support for FormData to be overloaded using `config.env.FormData` option;
Added support for FormData in node.js environment through `form-data` package;

* Added the `form-data` package as a dependency for the server build;
Added tests for FormData payload;

* Added FormData automatic serialization section;
Refactored cancellation section;

* Reworked toFormData helper;
Expose toFormData helper as a static method;
Refactored transform request;
Added kindOf, kindOfTest, endsWith, isTypedArray util;
Refactored utils.js to use kindOf for tests;

* Fixed isFormData predicate; (#4413)

Added support for automatic object serialization to FormData if `Content-Type` is `multipart/form-data`;
Added support for FormData to be overloaded using `config.env.FormData` option;
Added support for FormData in node.js environment using `form-data` package;

(cherry picked from commit 73e3bdb883)

* Added shortcut methods `postForm`, `putForm`, `patchForm` to submit a Form;
Added ability to submit FileList object as a FormData;
Updated README.md;

* Updated README.md;
2022-03-14 20:22:10 +02:00
DigitalBrainJS 7f1236652a Refactored AxiosError to a constructor;
Refactored `Cancel` to a constructor, a subclass of the `AxiosError`;
Expose CanceledError class;
Refactored axios error codes;
Added `toFlatObject` util;
2021-10-14 19:15:16 +03:00
Jay 76f09afc03 Release/v0.22.0 (#4107)
* fix/Avoid package.json import; (#4041)

* Added auto-generated config module `env/data.js` for importing package environment vars without importing the whole `package.json`;
Refactored `http.js` to use `env/data.js` instead of package.json;

* Added `env/data.js`;
Added `env/README.md`;

* Feat/export package version constant (#4065)

* Added auto-generated config module `env/data.js` for importing package environment vars without importing the whole `package.json`;
Refactored `http.js` to use `env/data.js` instead of package.json;

* Added `env/data.js`;
Added `env/README.md`;

* Export package version constant;

* Fixed cancelToken leakage; Added AbortController support; (#3305)

* Fixed cancelToken leakage;
Added AbortController support;

* Fixed typings;

* Documented `signal` option;

* Added processing of early cancellation using AbortController without sending a request;

Co-authored-by: Jay <jasonsaayman@gmail.com>

* Updating CI to run on release branches

* Fixed default transitional config for custom Axios instance; (#4052)

Refactored `/core/mergeConfig`;

Co-authored-by: Jay <jasonsaayman@gmail.com>

* Prepping v0.22.0 for release

* Updated date

Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
2021-10-01 08:02:13 +02:00
Isaac Whitfield 69d3cc4f3e Allow create() to be used recursively (#2795)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-09-05 12:24:50 +02:00
Jason Kwok f472e5da5f Adding a type guard for AxiosError (#2949)
Co-authored-by: Jason Kwok <JasonHK@users.noreply.github.com>
2020-11-03 10:01:07 +02:00
Martti Laine 72c66dfdec Refactor and introduce deepMerge 2018-03-23 20:21:02 +01:00
Martti Laine d78204712a Clean up PR 2018-03-09 13:58:08 +02:00
Martti Laine 5bfd2ea9f6 Fixing #385 - Keep defaults local to instance 2018-03-02 12:31:15 +02:00
Nick Uraltsev 6d0e19343a Fixing bug with custom intances and global defaults 2016-11-26 18:17:21 -08:00
Nick Uraltsev 216e2a6787 Adding axios.isCancel method 2016-09-21 18:47:37 -07:00
Nick Uraltsev 72dd897bb5 Adding cancellation support 2016-09-17 11:52:56 -07:00
Nick Uraltsev 5176dfdec5 Converting TypeScript definitions to ES2015 module syntax 2016-08-09 23:17:11 -07:00
Matt Zabriskie 6161754326 Instances created from axios.create have same API as default axios
closes #217
2016-06-23 15:43:42 -06:00
Matt Zabriskie 46eee269da Fixing custom instance defaults
closes #341
2016-06-23 15:19:10 -06:00
Matt Zabriskie 0e2f4f1417 Moving Axios class into core/ 2016-06-01 14:42:14 -06:00
Matt Zabriskie 203cbc2da0 Moving settle & transformData from helpers/ -> core/ 2016-06-01 13:54:38 -06:00
Joshua Egan 0d9996b1a0 Adding request function to exported singleton
#316
2016-05-17 13:54:34 -07:00
Thomas Reggi 5a20edeb0c added semicolon 2016-05-13 15:37:05 -04:00
Thomas Reggi 7548f2f79d export Axios fixes #320 2016-05-13 15:28:58 -04:00
Matt Zabriskie 70ef49eeb9 Bit of code cleanup 2016-01-24 15:27:30 -07:00
Matt Zabriskie 82847f737e Fixing config weirdness 2015-12-24 11:44:46 -07:00
Matt Zabriskie f28a4a8248 Using more strict eslint rules 2015-12-14 20:06:57 -07:00
Nick Uraltsev 435636c714 Add support for baseURL parameter 2015-11-21 23:51:59 -08:00
Matt Zabriskie affe3aaa9a Merge pull request #139 from ctimmerm/slice-arguments
Don't call slice on arguments
2015-10-28 14:52:50 -06:00
Colin Timmermans d6bcd62e4b Don't call slice on arguments
Calling slice on arguments can prevent optimizations in some JS engines
(see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments).
2015-10-28 11:25:40 +01:00
Colin Timmermans 1e2cb9bdca Don't use utils.forEach to loop over arguments
This fixes IE8 support, where we cannot relialably detect an arguments
object.
2015-10-27 23:26:04 +01:00
Nick Uraltsev 4ac0fbd1c1 Rename axios.createNew to axios.create 2015-10-23 08:40:46 -07:00
Nick Uraltsev b10874fa67 Make axios instantiable 2015-10-03 09:38:16 -07:00
mzabriskie 219a1c29ab Supporting a fetch like API 2015-09-29 00:04:00 -06:00
mzabriskie 95f0f00c77 Fixing axios to treat single string argument as URL
closes #116
2015-09-28 18:40:20 -06:00
Milo Mordaunt 1ccd4161c7 Added defaults.timeout to default config. 2015-09-24 15:53:41 -03:00
mzabriskie c573a12b74 Fixing issue with minified bundle in IE8
closes #87
2015-09-21 16:25:00 -06:00
mzabriskie e49237ce01 Removing es6-promise dependency 2015-08-10 19:00:27 -06:00
mzabriskie 0e33680f40 Removing deprecated success/error aliases
closes #57
2015-08-10 19:00:27 -06:00
mzabriskie 60a82ef424 Changing to file level use strict statement 2015-03-18 17:21:15 -06:00
mzabriskie a98c61f458 Adding ESLint 2015-03-17 14:14:26 -06:00
mzabriskie 8fded1802b Fixing issue with standalone build
closes #47
2015-03-10 14:30:49 -06:00
mzabriskie a9bcc8f419 Upgrading es6-promise dependency 2015-01-23 02:53:22 -07:00
mzabriskie bbf437ce4c Cleaning up core axios a bit 2015-01-23 02:11:57 -07:00
mzabriskie 9e3830cf92 Adding support for removing interceptors 2015-01-23 01:32:54 -07:00
Jason Dobry 5bb39f3279 Initial interceptor implementation. 2014-12-06 00:14:28 -07:00
mzabriskie 2eda22127e Deprecating success/error in favor of then/catch 2014-09-29 22:37:04 -06:00
mzabriskie 1b803fb233 Moving stuff to helpers/ 2014-09-22 11:12:24 -06:00
mzabriskie f406b092fc Fixing failing tests 2014-09-22 10:47:41 -06:00
mzabriskie 59eb2b6204 Fixing issue #8 2014-09-16 11:52:56 -06:00
mzabriskie 1fa35ced3c Fixing issue #7 2014-09-16 11:51:29 -06:00
mzabriskie f4a334e17c Adding support for node 2014-09-12 12:38:17 -06:00
Matt Zabriskie c43f2b9710 Adding support for all and spread 2014-09-05 15:48:58 -06:00