2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-18 12:39:44 +03:00
Commit Graph

11 Commits

Author SHA1 Message Date
Dmitriy Mozgovoy 7821ed2089 Feat/json improvements (#3763)
* 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;
2021-04-19 22:05:48 +02:00
Dmitriy Mozgovoy 5ad6994da3 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);
2021-04-19 18:55:34 +02:00
Nick Uraltsev 46a9639ef2 Fixing sporadically failing tests 2016-10-29 21:58:06 -07:00
Matt Zabriskie dcbb352262 Moving test helpers and auto-loading them 2016-03-07 13:21:27 -07:00
Matt Zabriskie dc07ef2559 Fixing tests for IE 2016-03-05 23:17:39 -07:00
Matt Zabriskie 371b82a2a0 Cleaning up tests a bit 2016-03-04 10:35:05 -07:00
mzabriskie a517a23982 Adding test for parsing JSON response 2015-04-12 15:53:21 -06:00
mzabriskie b745600ab7 Using webpack for testing 2015-03-18 10:45:06 -06:00
mzabriskie 0438dd3bac Updating karma 2015-02-17 01:11:39 -07:00
Jason Dobry 5bb39f3279 Initial interceptor implementation. 2014-12-06 00:14:28 -07:00
mzabriskie ede39aaea9 Adding tests for transformers 2014-10-05 17:27:25 -06:00