1. 15 3月, 2022 1 次提交
    • D
      Improved FormData support; (#4448) · 6b9b05b9
      Dmitriy Mozgovoy 提交于
      * 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 73e3bdb8)
      
      * 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;
      6b9b05b9
  2. 08 3月, 2022 2 次提交
  3. 07 3月, 2022 1 次提交
  4. 13 2月, 2022 1 次提交
  5. 02 2月, 2022 1 次提交
    • D
      Fixed isFormData predicate; (#4413) · 73e3bdb8
      Dmitriy Mozgovoy 提交于
      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;
      73e3bdb8
  6. 27 1月, 2022 1 次提交
    • J
      Fix/remove url required (#4426) · cc86c6c4
      Jay 提交于
      * Removed error when url is null as this breaks current use cases for alot of projects
      
      * Removed associated tests that check for the for url to not be empty
      cc86c6c4
  7. 18 1月, 2022 1 次提交
  8. 23 12月, 2021 4 次提交
    • H
      Adding error handling when missing url (#3791) · 95792908
      Hirotaka Tagawa / wafuwafu13 提交于
      * Fixing error message when missing url
      
      * Fixing missing url
      
      * Adding missing url case
      
      * Update Axios.js
      
      * Update requests.spec.js
      
      * Update api.spec.js
      
      * Update api.spec.js
      
      * Update api.spec.js
      Co-authored-by: NJay <jasonsaayman@gmail.com>
      95792908
    • B
      toFormData helper function (#3757) · 99648153
      Ben Carp 提交于
      * adding toFormData test
      
      * adding toFormData
      Co-authored-by: NJay <jasonsaayman@gmail.com>
      99648153
    • W
      (Add tests to) document how multiple inceptors work (#3564) · e6aef5a1
      Wolfram Kriesing 提交于
      * Add a group for the multiple-interceptors tests.
      
      The current test contains a lot of details that are worth being tested
      separately and also made explicit. This is what is coming with the next changes.
      
      * Fix indentation.
      
      * Make explicit that the test only tests the interception of the fulfilled part.
      
      * Indent.
      
      * Make the test just test a tiny bit, as described.
      
      The more explicit the test, the better we can 1) describe what it does
      and use that for the docs to make them understandable 2) have a better
      explicit description of the API (in case we want to modify it) and 3) have
      a regression test when changing.
      
      * Add a test that explicitly shows that the order of interceptors is as they were added.
      
      * Pull out reusable code, to make the tests more explicitly stating the things they care about.
      
      * Write a test showing that the responses are not merged or anything,
      only the last one in the chain is returned.
      
      * Make visible that the interceptors are a chain, one receives its predecessor's data.
      
      * Test what happens when the interceptor throws.
      
      * Refactor, add another group of tests and pull helper function there.
      
      The previous change to also catch in the helper function was not needed
      for any of the tests above, so remove it and put it in the describe-block
      below where it is needed.
      Just trying to write the specific code needed, not more.
      Not sure about the impact for failing tests, I am glad about input.
      But the main intention here is to have minimal code, explicit tests and
      not too much generic code which might break itself eventually.
      
      * Documenting that the following reject-interceptor gets called.
      
      * Documenting how the interceptor chain handles caught rejections.
      
      * Document "multiple interceptors".
      
      I just extracted the test descriptions from the new/modified tests.
      And I also learned that I should improve the test descriptions, the
      tests are just in a GIVEN-WHEN-THEN structure, so I can also use those
      terms better. Will do this next.
      
      * Transfer the better readable descriptions as I changed them in the README back into the tests.
      
      After I had updated the README using the test descriptions I realized how
      the test descriptions can be improved, so I did this "moving" the learnings
      back into the code.
      
      * Be a bit more explicit, it was not clear when reading, imho.
      
      * Add new lines to be kinda consistent with the rest of the file.
      Co-authored-by: NJay <jasonsaayman@gmail.com>
      e6aef5a1
    • B
      refactor(helpers): optimize the logic of isAxiosError (#3546) · 6fca6a70
      Black-Hole 提交于
      1. add the judgment of null
      Co-authored-by: NJay <jasonsaayman@gmail.com>
      6fca6a70
  9. 15 10月, 2021 1 次提交
  10. 01 10月, 2021 1 次提交
    • J
      Release/v0.22.0 (#4107) · 76f09afc
      Jay 提交于
      * 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: NJay <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: NJay <jasonsaayman@gmail.com>
      
      * Prepping v0.22.0 for release
      
      * Updated date
      Co-authored-by: NDmitriy Mozgovoy <robotshara@gmail.com>
      76f09afc
  11. 06 9月, 2021 1 次提交
  12. 05 9月, 2021 2 次提交
  13. 21 5月, 2021 1 次提交
  14. 20 4月, 2021 2 次提交
    • D
      Feat/json improvements (#3763) · 7821ed20
      Dmitriy Mozgovoy 提交于
      * Draft
      
      * Added support for primitive types to be converted to JSON if the request Content-Type is 'application/json';
      Added throwing SyntaxError if JSON parsing failed and responseType is json;
      Added transitional option object;
      Added options validator to assert transitional options;
      Added transitional option `silentJSONParsing= true` for backward compatibility;
      Updated README.md;
      Updated typings;
      
      * Fixed isOlderVersion helper;
      Fixed typo;
      Added validator.spec.js;
      
      * Added forcedJSONParsing transitional option #2791
      
      * `transformData` is now called in the default configuration context if the function context is not specified (for tests compatibility);
      
      * Added `transitional.clarifyTimeoutError` to throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts;
      Added support of onloadend handler if available instead of onreadystatechange;
      Added xhr timeout test;
      Fixed potential bug of xhr adapter with proper handling timeouts&errors (FakeXMLHTTPRequest failed to handle timeouts);
      
      * Removed unnecessary assertion;
      7821ed20
    • D
      JSON improvements: throw if JSON parsing failed; number, boolean can be passed... · 5ad6994d
      Dmitriy Mozgovoy 提交于
      JSON improvements: throw if JSON parsing failed; number, boolean can be passed directly as payload for encoding to JSON #2613, #61, #907 (#3688)
      
      * Draft
      
      * Added support for primitive types to be converted to JSON if the request Content-Type is 'application/json';
      Added throwing SyntaxError if JSON parsing failed and responseType is json;
      Added transitional option object;
      Added options validator to assert transitional options;
      Added transitional option `silentJSONParsing= true` for backward compatibility;
      Updated README.md;
      Updated typings;
      
      * Fixed isOlderVersion helper;
      Fixed typo;
      Added validator.spec.js;
      
      * Added forcedJSONParsing transitional option #2791
      
      * `transformData` is now called in the default configuration context if the function context is not specified (for tests compatibility);
      
      * Added `transitional.clarifyTimeoutError` to throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts;
      Added support of onloadend handler if available instead of onreadystatechange;
      Added xhr timeout test;
      Fixed potential bug of xhr adapter with proper handling timeouts&errors (FakeXMLHTTPRequest failed to handle timeouts);
      5ad6994d
  15. 18 4月, 2021 1 次提交
  16. 01 3月, 2021 1 次提交
  17. 03 11月, 2020 1 次提交
  18. 04 10月, 2020 1 次提交
  19. 01 10月, 2020 1 次提交
  20. 20 9月, 2020 1 次提交
  21. 12 9月, 2020 1 次提交
  22. 11 6月, 2020 1 次提交
  23. 09 6月, 2020 1 次提交
    • X
      Refactor mergeConfig without utils.deepMerge (#2844) · 0d69a79c
      Xianming Zhong 提交于
      * Adding failing test
      
      * Fixing #2587 default custom config persisting
      
      * Adding Concat keys and filter duplicates
      
      * Fixed value from CPE
      
      * update for review feedbacks
      
      * no deepMerge
      
      * only merge between plain objects
      
      * fix rename
      
      * always merge config by mergeConfig
      
      * extract function mergeDeepProperties
      
      * refactor mergeConfig with all keys, and add special logic for validateStatus
      
      * add test for resetting headers
      
      * add lots of tests and fix a bug
      
      * should not inherit `data`
      
      * use simple toString
      
      * revert #1845
      Co-authored-by: NDavid Tanner <david.tanner@lifeomic.com>
      Co-authored-by: NJustin Beckwith <justin.beckwith@gmail.com>
      0d69a79c
  24. 05 6月, 2020 1 次提交
  25. 28 5月, 2020 1 次提交
  26. 27 5月, 2020 3 次提交
  27. 23 5月, 2020 2 次提交
  28. 23 3月, 2020 1 次提交
  29. 15 2月, 2020 2 次提交
    • X
      Fix tests in browsers (#2748) · 2034c1db
      Xianming Zhong 提交于
      2034c1db
    • J
      Fix merging of params (#2656) · 77f0ae4f
      Jonathan Sharpe 提交于
      * Name function to avoid ESLint func-names warning
      
      * Switch params config to merge list and update tests
      
      * Restore testing of both false and null
      
      * Restore test cases for keys without defaults
      
      * Include test for non-object values that aren't false-y.
      77f0ae4f
  30. 21 1月, 2020 1 次提交