![]() ![]() The simplicity of setting a timeout in Axios is one of the reasons some developers prefer it to fetch(). Keep in mind that that you might also need a promise polyfill in some old browsers. ![]() Then, you can make requests like this: import 'whatwg-fetch' To begin using the fetch() polyfill, install it via npm command like so: npm install whatwg-fetch -save Instead, you can use fetch() with a polyfill like this to implement similar functionality on web browsers that do not support fetch(). If your only reason for using Axios is backward compatibility, you don’t really need an HTTP library. This is because it uses XMLHttpRequest under the hood.įetch(), on the other hand, only supports Chrome 42+, Firefox 39+, Edge 14+, and Safari 10.3+ (you can see the full compatibly table on ). Even old browsers like IE11 can run Axios without any issue. One of the main selling points of Axios is its wide browser support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |